Rick Brewster Posted July 12, 2019 Posted July 12, 2019 (edited) Midora seems to have abandoned the plugin and @Pixey's been unable to reach him. This plugin doesn't work in Paint.NET 4.2 because it's using a class that's now internal. The plugin shouldn't have been doing that, and I'm not going to change my code to accommodate it. So, I disassembled it, fixed the build errors, and fixed up all (hopefully) the pointer code that Reflector bungled, and here we go. Please try this out and let me know if you run into any problems. If it all works out then @Ego Eram Reputo can update the original plugin page with this version. Here's the plugin's actual post/page: Edited August 30, 2019 by toe_head2001 Removed download 2 1 The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html
Ego Eram Reputo Posted July 13, 2019 Posted July 13, 2019 Spoiler Application version: paint.net 4.2 System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) at PaintDotNet.Data.Quantize.Quantizer.ReplacePassWithDithering(BitmapData in32Data, List`1 lc, Int32 width, Int32 height, Int32 ditherLevel, ProgressEventHandler progressCallback) in C:\src\github\ImAGIF.FileType\PaintDotNet\Data\Quantize\Quantizer.cs:line 418 at PropertyBasedFileTypes.ImAgifFileType.DoSave(Document input, Stream output, PropertyBasedSaveConfigToken token, Surface scratchSurface, ProgressEventHandler progressCallback) in C:\src\github\ImAGIF.FileType\PropertyBasedFileTypes\ImAgifFileType.cs:line 275 at PropertyBasedFileTypes.ImAgifFileType.OnSaveT(Document input, Stream output, PropertyBasedSaveConfigToken token, Surface scratchSurface, ProgressEventHandler progressCallback) in C:\src\github\ImAGIF.FileType\PropertyBasedFileTypes\ImAgifFileType.cs:line 542 at PaintDotNet.FileType.Save(Document input, Stream output, SaveConfigToken token, Surface scratchSurface, ProgressEventHandler callback, Boolean rememberToken) in D:\src\pdn\src\Data\FileType.cs:line 276 at PaintDotNet.Dialogs.SaveConfigDialog.<>c__DisplayClass48_0.<UpdatePreviewAsync>b__0() in D:\src\pdn\src\PaintDotNet\Dialogs\SaveConfigDialog.cs:line 604 at System.Threading.Tasks.Task.Execute() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at PaintDotNet.Dialogs.SaveConfigDialog.<UpdatePreviewAsync>d__48.MoveNext() in D:\src\pdn\src\PaintDotNet\Dialogs\SaveConfigDialog.cs:line 623 The file I was attempting to save (attached) had one hidden layer. Deleting this layer allowed the file to save without error. ActiveLayerDemo.zip ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker
Rick Brewster Posted July 13, 2019 Author Posted July 13, 2019 Does that work/not-work in 4.1.6 with the 0.12 plugin? The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html
Rick Brewster Posted July 13, 2019 Author Posted July 13, 2019 Looks like it works fine in 4.1.6 + 0.12. Darn it The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html
Rick Brewster Posted July 13, 2019 Author Posted July 13, 2019 Okay well, I've already put a ton of time into this and I have to move on. Happy to open up the GitHub repo to anyone else if they're motivated to fix up any leftover bugs, but I can't spend any more time on this. @null54? @Bruce Bowyer-Smyth? @BoltBait? dnspy may be a better choice for disassembling the code. Reflector may have just garbled too much of it. The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html
Pixey Posted July 13, 2019 Posted July 13, 2019 I just tried it out in 4.2 and all is well: So now can I attach the new/fixed version into Midora's thread ? 1 How I made Jennifer & Halle in Paint.net My Gallery | My Deviant Art "Rescuing one animal may not change the world, but for that animal their world is changed forever!" anon.
Rick Brewster Posted July 13, 2019 Author Posted July 13, 2019 No, not yet. @Ego Eram Reputo still has a bug with the image he was trying above ^^^ Could be worth making a thread in the Plugin Developer Central though. At least we can provide people with a beta. The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html
Ego Eram Reputo Posted July 14, 2019 Posted July 14, 2019 9 hours ago, Rick Brewster said: Could be worth making a thread in the Plugin Developer Central though. At least we can provide people with a beta. Can I move this thread? ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker
Rick Brewster Posted July 14, 2019 Author Posted July 14, 2019 Sure 👍 The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html
Bruce Bowyer-Smyth Posted July 14, 2019 Posted July 14, 2019 I can't find the difference between the old and the new just by reading the decompile. dotPeek does the pointer code correctly if someone is keen. GPU Blur Plugin | WMF File Plugin
toe_head2001 Posted July 15, 2019 Posted July 15, 2019 Is anyone already working on this? If not, I'm willing to take a look. My Gallery | My Plugin Pack Layman's Guide to CodeLab
BoltBait Posted July 15, 2019 Posted July 15, 2019 1 hour ago, toe_head2001 said: Is anyone already working on this? I'm not. I'm no FileType expert. (In fact, I'm not even a FileType beginner.) Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game
Rick Brewster Posted July 15, 2019 Author Posted July 15, 2019 2 hours ago, toe_head2001 said: Is anyone already working on this? If not, I'm willing to take a look. It's on GitHub, you should now have access. If not let me know. 1 The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html
toe_head2001 Posted July 15, 2019 Posted July 15, 2019 (edited) I simply told the plugin to skip over invisible Layers. if (layers[i] is Layer layer && !layer.Visible) { continue; } Seems to work around the issue that I don't completely understand. Or is this plugin supposed to do something special with invisible layers? (I haven't used this plugin enough to know its "ins and outs") @Pixey , @Ego Eram Reputo, et al? EDIT: this doesn't fully solve the issue. Edited July 16, 2019 by toe_head2001 1 3 My Gallery | My Plugin Pack Layman's Guide to CodeLab
Pixey Posted July 16, 2019 Posted July 16, 2019 I will test it tomorrow @toe_head2001 I have family staying and it's a bit hectic today. As for invisible layers, as far as I can remember, if you did that you would just get an uneven rhythm in the finished .gif, - like a flash. How I made Jennifer & Halle in Paint.net My Gallery | My Deviant Art "Rescuing one animal may not change the world, but for that animal their world is changed forever!" anon.
lynxster4 Posted July 16, 2019 Posted July 16, 2019 (edited) I just tested this @toe_head2001. I don't have any problems with Rick's version, that I could see. I used a pdn file from the example folder. However, your version does not work unless all the layers are ticked. I can build a working gif with the pdn file with some layers turned 'off' in Rick's version. Notice nine (9) layers are unchecked. The gif builds just fine, leaving the layers 'as is'. With yours, the unchecked layers get skipped over. The gif still 'builds', but it isn't animated. I had to 'check' all the layers to get the gif to build correctly. If you have a lot of layers, it would be a pain to tick them all. Just letting you know.... EDIT: And I honestly don't know what is going on with EER's example. I can't find a hidden layer. If all of them are checked, it still doesn't build. Edited July 16, 2019 by lynxster4 1 My Art Gallery | My Shape Packs | ShapeMaker Mini Tut | Air Bubble Stained Glass Chrome Text with Reflections | Porcelain Text w/ Variegated Coloring | Realistic Knit PatternOpalescent Stained Glass | Frosted Snowman Cookie | Leather Texture | Plastic Text | Silk Embroidery Visit my Personal Website "Never, ever lose your sense of humor - you'll live longer"
toe_head2001 Posted July 16, 2019 Posted July 16, 2019 1 hour ago, lynxster4 said: The gif still 'builds', but it isn't animated. I had to 'check' all the layers to get the gif to build correctly. You shouldn't need to check all layers; you just to check at least two frame layers. You have only one checked. Foreground and background don't count as frames. 1 hour ago, lynxster4 said: If you have a lot of layers, it would be a pain to tick them all. Just letting you know.... Ok, that's a fair point. My Gallery | My Plugin Pack Layman's Guide to CodeLab
toe_head2001 Posted July 16, 2019 Posted July 16, 2019 Ok, I've taken a further look at this, and the issue is not dependent on later visibility. Still working on it. My Gallery | My Plugin Pack Layman's Guide to CodeLab
toe_head2001 Posted July 16, 2019 Posted July 16, 2019 (edited) Ok, this reverts the layer visibility change, and should fix the issue found by @Ego Eram Reputo. Please confirm. Edited August 30, 2019 by toe_head2001 Removed download 1 My Gallery | My Plugin Pack Layman's Guide to CodeLab
lynxster4 Posted July 16, 2019 Posted July 16, 2019 I can confirm it works without all layers ticked. EER will have to confirm his issue. Thanks @toe_head2001! My Art Gallery | My Shape Packs | ShapeMaker Mini Tut | Air Bubble Stained Glass Chrome Text with Reflections | Porcelain Text w/ Variegated Coloring | Realistic Knit PatternOpalescent Stained Glass | Frosted Snowman Cookie | Leather Texture | Plastic Text | Silk Embroidery Visit my Personal Website "Never, ever lose your sense of humor - you'll live longer"
Seerose Posted July 16, 2019 Posted July 16, 2019 @Rick Brewster! @toe_head2001! @lynxster4! I have difficulties to understand. What about the layers? Please everyone: "do not let me die stupid." Live as if you were to die tomorrow. Learn as if you were to live forever. Gandhi
toe_head2001 Posted July 16, 2019 Posted July 16, 2019 14 minutes ago, Seerose said: I have difficulties to understand. What about the layers? The issue with the layers has been resolved. There's no need to be concerned about it. You just need to confirm the plugin works normally and without issues. My Gallery | My Plugin Pack Layman's Guide to CodeLab
Seerose Posted July 16, 2019 Posted July 16, 2019 (edited) @toe_head2001! Thank you for the quick answer. Edited July 16, 2019 by Seerose Live as if you were to die tomorrow. Learn as if you were to live forever. Gandhi
Ego Eram Reputo Posted July 17, 2019 Posted July 17, 2019 10 hours ago, toe_head2001 said: Ok, this reverts the layer visibility change, and should fix the issue found by @Ego Eram Reputo. Please confirm. ImAGIF.FileType-Test2.zip 499.04 kB · 3 downloads This version is includes hidden layers in the animation. In the attached file there is a path layer and a black layer which were both hidden. At least it completes the save ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker
BoltBait Posted July 17, 2019 Posted July 17, 2019 Maybe there needs to be an option: [X] Include hidden layers Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game
Recommended Posts