-
1. Re: Need to support a new image format with .JPG extension
Chris Cox Jan 11, 2010 12:03 PM (in response to G_Soucy)For JPEG/JPG you have to override the support built into Photoshop.
That means you have to change the priority value so your format will run before ACR and Photoshop itself.
1) yes, clearly explained in the SDK
2) yes, clearly explained in the SDK
(Why do I know it's clear? Because I wrote the same sort of JPEG override format plugin 15 years ago.)
-
2. Re: Need to support a new image format with .JPG extension
ilvar Jan 11, 2010 1:03 PM (in response to G_Soucy)Just as Chris said, its very much doable and we went through a similar process very recently. You may want to check this post ( http://forums.adobe.com/thread/359900? ) that deals with one quirky issue that popped up during the development.
-
3. Re: Need to support a new image format with .JPG extension
G_Soucy Jan 11, 2010 3:45 PM (in response to ilvar)Thank you. I get the big picture:
- I must change the priority of my plugin to be called before the default JPEG plugin.
- I must enable the FilterSelector to test the file and reject it when it is a regular JPEG.
To change the priority, I added this line to my resource:
Priority { 0 },
(lower number will be loaded first according to the doc).
Only problem is that I have a hard time to activate the Filter event. I tried the sample simpleFormat CS4 plugin out of the SDK box and the Filter event is not triggered.
The resource for the simpleFormat plugin are
FmtFileType { 'SME ', '8BIM' },
//ReadTypes { { '8B1F', ' ' } },
FilteredTypes { { '8B1F', ' ' } },
ReadExtensions { { 'SME ' } },
WriteExtensions { { 'SME ' } },
FilteredExtensions { { 'SME ' } },
How can I get the Filter event before I get the ReadPrepare event ?
The only way I got the filter event is when I tried:
Priority { -1000 },
FmtFileType { 'SME ', '8BIM' },
//ReadTypes { { '8B1F', ' ' } },
FilteredTypes { { ' ', ' ' } },
ReadExtensions { { 'JPG ', 'SME ' } },
WriteExtensions { { 'SME ' } },
FilteredExtensions { { 'JPG ', 'SME ' } },
(i.e. using 4 spaces in the Filtered Types).
However, even with priority -1000, my plugin is still not called for a .JPG file to filter the file and reject it.
Thank you!
Gilbert
-
4. Re: Need to support a new image format with .JPG extension
G_Soucy Jan 12, 2010 8:42 AM (in response to G_Soucy)Ok, I finally got everything to work as I wanted with these PiPL resources (note that my new extension and file format is MW):
FmtFileType { 'MW ', '8BIM' },
//ReadTypes { { '8B1F', ' ' } },
FilteredTypes { { 'MW ', ' '}},
ReadExtensions { {'MW ' } },
WriteExtensions { { 'MW ' } },
FilteredExtensions { { 'JPG ', 'MW ' } },
I dont actually need to play with the priority apparently. My plugin gets called for a MW (my new format) with .jpg or with a .mw extension and I can read it fine. When it is a regular JPG file, I filter it and return 'formatCannotRead' from the formatSelectorFilterFile event and Photoshop takes over the reading of that file.
Thanks for your help!
Gilbert
-
5. Re: Need to support a new image format with .JPG extension
G_Soucy Mar 11, 2010 11:56 AM (in response to G_Soucy)This is a relatively old posting but i have a new question on the same topic.
I have a new format plugin that supports 2 extensions: 'MW' and 'JPG' (i.e. the MW files can sometimes have .JPG extensions ). Using the
FilteredExtensions { { 'JPG ', 'MW ' } },
in the PiPL resource works nicely to redirect the .JPG files to my plugin to validate the header (I can then reject them or read them if they happen to be MW files).
Q: when a MW file with .JPG extension is loaded, if you do 'Save As', photoshop will propose the orginal filename with .MW extension (although the orignal name had .JPG extension). Is there a way to configure the plugin so that the original file name will be preserved (with its original JPG extension) even though it will be saved in MW format ? Of course I can simply replace manually the extension but a few users would prefer to not have to do that.
Thank you!
Gilbert
-
6. Re: Need to support a new image format with .JPG extension
Chris Cox Mar 11, 2010 1:57 PM (in response to G_Soucy)No. If you read multiple extensions, Photoshop will still only use the primary file extension for the format when saving.
(it's an MW format, or it's a JPEG format... it really shouldn't be both)



