Jump to content

Loading Standard Extension with FileType Plugin


nickgravelyn
 Share

Recommended Posts

I'm working on a FileType plugin, the goal of which is to be able to compose an animation strip (a set of frames laid out horizontally) and have it save an animated GIF file. I'm sure I can manage that portion just fine but I also wanted to be able to load an animated GIF file and make a strip out of the frames. I'm able to do this with code just fine but it seems that Paint.NET will always use the standard GIF loader when loading the file, even if I explicitly choose my "Animated Gif File" option from the load dialog.

Is there any way to get Paint.NET to use my plugin instead of the default file type? Or somehow get rid of the existing GIF loader?

(As a side note it might be nice to make the standard file loading and saving as plugins that way users could simply delete the old GIF plugin DLL and put mine in place of it.)

Link to comment
Share on other sites

Thanks for pointing that out, but it suffers a few issues I don't like:

1) It puts each frame on a layer instead of laying them out in a sheet.

2) They, too, have to use a new extension "agif". This may not be solvable, though.

If I can't solve the second, then I guess I'll just have to deal with it, but I definitely prefer animation strips over using layers as frames. Personal preference, I suppose.

So back to the issue at hand, anyone know of a way to get Paint.NET to use my plugin for a GIF file or am I forced to use a different extension?

Link to comment
Share on other sites

I don't want to hack up a solution using reflection, not because of whether I can list the plugin here, but because it makes the plugin unstable to future updates in the event that they change something as minimal as a field's name. Definitely not a can of worms I want to deal with.

Since my thread in the suggestion forum was closed as a cross-post of this, I definitely hope that the PDN team can realize that this is an oversight and it should be corrected. Not only for things for animated GIFs, but for any file type. It's possible that a plugin developer could make something that exposes more functionality or performs better/differently for a given file, but currently the application doesn't allow users to choose those plugins over the internal file types.

Link to comment
Share on other sites

I don't want to hack up a solution using reflection, not because of whether I can list the plugin here, but because it makes the plugin unstable to future updates in the event that they change something as minimal as a field's name. Definitely not a can of worms I want to deal with.

I wasn't encouraging you to, which is why my plugin uses a different extension.

If users want to edit animated PNGs and still have the file with the correct extension available, I guess they could be pointed to a tutorial on symbolic links.

KaHuc.png
Link to comment
Share on other sites

If users want to edit animated PNGs and still have the file with the correct extension available, I guess they could be pointed to a tutorial on symbolic links.
Or support for overriding default file extensions for loading will get implemented so users don't have to be hassled. :D

I actually found out that my plugin can save out to a standard GIF extension just fine, i.e. it doesn't default to the standard GIF FileType when I save if I explicitly choose my file type from the drop down menu. However the same doesn't work when loading. So it seems like all that needs doing is to see whether the user, when loading a file, explicitly chose the plugin file type or not.

But for now I'll just tell people to change the file extension to "agif" before opening the file if they want to read a GIF file. To me saving was far more the important factor and that works just fine, so I consider my plugin a success for me at least. :)

Link to comment
Share on other sites

I actually found out that my plugin can save out to a standard GIF extension just fine, i.e. it doesn't default to the standard GIF FileType when I save if I explicitly choose my file type from the drop down menu. However the same doesn't work when loading. So it seems like all that needs doing is to see whether the user, when loading a file, explicitly chose the plugin file type or not.

Or force all FileTypes covering duplicate extensions to have config dialogs and make it changeable there.

file extension to "agif"

Although you should probably use another extension, in case users have both plugins installed.

KaHuc.png
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...