Plugin version problems (resource issue?)

S
Posted By
skahil
Jun 29, 2005
Views
511
Replies
4
Status
Closed
I am developing a Photoshop file format plugin to read a file format called *.KAP using SDK version 5.0.

The problem I am having is that though Photoshop v5.0 will acknowledge my plugin, newer versions of Photoshop (7.1) and Photoshop elements (3.0) do not.
i.e. My file format does not show up in the OPEN dialog, and when I try to open I get a "wrong file type" error.

Now as I understand it Photoshop scans the contents of the Plugins directory and reads the resources of the files stored there looking for PiPL resources.
This leads me to conclude that I have screwed up my resource file somehow.
The format of the file that CnvtPiPL.exe accepts is a bit of a mystery to me so I was hoping that someone could either enlighten me as to what I have done wrong or point me to some documentation.

Alternatively, perhaps there is something more fundamental going on like a type of resource that the newer Photoshop programs are looking for that I don’t know about or some lack of backward compatibility.

I would really appreciate any help you could offer on the subject. Thanks,
Sean.

I have simply modified the example resource file it can be found here: http://awh1.Apocgraphy.com/download/SimpleFormat.r

The PiPL section is as follows:
resource ‘PiPL’ (ResourceID, plugInName " PiPL", purgeable) {
{
Kind { ImageFormat },
Name { plugInName },
Version { (latestFormatVersion << 16) | latestFormatSubVersion },

#if Macintosh
Code68K { ImageFormat, $$ID },
CodePowerPC { 0, 0, "" },
#endif

#if MSWindows
CodeWin32X86 { "ENTRYPOINT" },
#endif

// ClassID, eventID, aete ID, uniqueString:
HasTerminology { plugInClassID, plugInEventID, ResourceID, vendorName " " plugInName },

SupportedModes
{
noBitmap, noGrayScale,
doesSupportIndexedColor, noRGBColor,
noCMYKColor, noHSLColor,
noHSBColor, noMultichannel,
noDuotone, noLABColor
},

EnableInfo { "true" },

FmtFileType { ‘8B1F’, ‘8BIM’ },
//ReadTypes { { ‘8B1F’, ‘ ‘ } },
FilteredTypes { { ‘8B1F’, ‘ ‘ } },
ReadExtensions { { ‘KAP ‘ } },
WriteExtensions { { ‘KAP ‘ } },
FilteredExtensions { { ‘KAP ‘ } },
FormatFlags { fmtDoesNotSaveImageResources, fmtCanRead,
fmtCannotWrite, fmtCanWriteIfRead },
FormatMaxSize { { 32767, 32767 } },
FormatMaxChannels { { 1, 24, 24, 24, 24, 24,
24, 24, 24, 24, 24, 24 } }
}
};

Master Retouching Hair

Learn how to rescue details, remove flyaways, add volume, and enhance the definition of hair in any photo. We break down every tool and technique in Photoshop to get picture-perfect hair, every time.

T
toby
Jun 30, 2005
wrote:
I am developing a Photoshop file format plugin to read a file format called *.KAP using SDK version 5.0.

The problem I am having is that though Photoshop v5.0 will acknowledge my plugin, newer versions of Photoshop (7.1) and Photoshop elements (3.0) do not.

That is to be expected. The Mac versions of Photoshop 7.0 and CS require code linked against CarbonLib. To distinguish such code from plugins built for the older "classic" PowerPC runtime, a new code property was defined. The Photoshop 5.0 SDK does not include this property, but it is trivial to add. Once this is done, you can properly identify code that’s loadable under PS7’s Carbon runtime. (Note, I have never seen or used the PS7 or later SDKs; this information is from my own investigations and was originally posted here:
http://groups-beta.google.com/group/comp.graphics.apps.photo shop/msg/3da3dbd2bde8aad0?hl=en also noting a couple of other minor fixes to support Carbon building.)

Open the file Resources/PiPL.r, and find the "CodePowerPC" property. Add a similar one after it like so:

case CodePowerPCbundle:
longint = ‘8BIM’;
key longint = ‘ppcb’;
longint = 0;
#if DeRez
fill long;
#else
longint = (ppcbEnd[$$ArrayIndex(properties)] –
ppcbStart[$$ArrayIndex(properties)]) / 8;
#endif
ppcbStart:
longint;
longint;
pstring;
ppcbEnd:
align long;

(Photoshop 7 running under Classic will use the older plugin format, in other words behaving just like an earlier version.)

You will also need to change the way your code is compiled and linked. If you are using CodeWarrior, you can set your prefix file to MacCarbonHeaders.h and link against CarbonLib (and MSL if you use it) only. Note that the resulting code will *only* load in PS7 or CS; it is not valid for any version of Photoshop running under MacOS 9 or earlier. For those, you continue to build and link in the old way, using the CodePowerPC property.

Likewise, Mac Photoshop CS2 introduces yet another property because its plugins must be in Mach-O format:

case CodeMachO:
longint = ‘8BIM’;
key longint = ‘mach’;
longint = 0;
#if DeRez
fill long;
#else
longint = (machEnd[$$ArrayIndex(properties)] –
machStart[$$ArrayIndex(properties)]) / 8;
#endif
machStart:
longint;
longint;
pstring;
machEnd:
align long;

This can be added to any SDK to build plugins for CS2. Instructions for porting your code to the Mach-O/gcc build system are beyond the scope of this post, but a complete example, including Makefile, is here: http://www.telegraphics.com.au/svn/icoformat/trunk/ (Subversion repository).

Plugin projects and source code for all configurations of Photoshop, including Windows, are available on my site,
http://www.telegraphics.com.au/sw/

Don’t hesitate to contact me with any further questions.

–Toby

i.e. My file format does not show up in the OPEN dialog, and when I try to open I get a "wrong file type" error.
T
toby
Jun 30, 2005
wrote:
I am developing a Photoshop file format plugin to read a file format called *.KAP using SDK version 5.0.

The problem I am having is that though Photoshop v5.0 will acknowledge my plugin, newer versions of Photoshop (7.1) and Photoshop elements (3.0) do not.

That is to be expected. The Mac versions of Photoshop 7.0 and CS require code linked against CarbonLib. To distinguish such code from plugins built for the older "classic" PowerPC runtime, a new code property was defined. The Photoshop 5.0 SDK does not include this property, but it is trivial to add. Once this is done, you can properly identify code that’s loadable under PS7’s Carbon runtime. (Note, I have never seen or used the PS7 or later SDKs; this information is from my own investigations and was originally posted here:
http://groups-beta.google.com/group/comp.graphics.apps.photo shop/msg/3da3dbd2bde8aad0?hl=en also noting a couple of other minor fixes to support Carbon building.)

Open the file Resources/PiPL.r, and find the "CodePowerPC" property. Add a similar one after it like so:

case CodePowerPCbundle:
longint = ‘8BIM’;
key longint = ‘ppcb’;
longint = 0;
#if DeRez
fill long;
#else
longint = (ppcbEnd[$$ArrayIndex(properties)] –
ppcbStart[$$ArrayIndex(properties)]) / 8;
#endif
ppcbStart:
longint;
longint;
pstring;
ppcbEnd:
align long;

(Photoshop 7 running under Classic will use the older plugin format, in other words behaving just like an earlier version.)

You will also need to change the way your code is compiled and linked. If you are using CodeWarrior, you can set your prefix file to MacCarbonHeaders.h and link against CarbonLib (and MSL if you use it) only. Note that the resulting code will *only* load in PS7 or CS; it is not valid for any version of Photoshop running under MacOS 9 or earlier. For those, you continue to build and link in the old way, using the CodePowerPC property.

Likewise, Mac Photoshop CS2 introduces yet another property because its plugins must be in Mach-O format:

case CodeMachO:
longint = ‘8BIM’;
key longint = ‘mach’;
longint = 0;
#if DeRez
fill long;
#else
longint = (machEnd[$$ArrayIndex(properties)] –
machStart[$$ArrayIndex(properties)]) / 8;
#endif
machStart:
longint;
longint;
pstring;
machEnd:
align long;

This can be added to any SDK to build plugins for CS2. Instructions for porting your code to the Mach-O/gcc build system are beyond the scope of this post, but a complete example, including Makefile, is here: http://www.telegraphics.com.au/svn/icoformat/trunk/ (Subversion repository).

Plugin projects and source code for all configurations of Photoshop, including Windows, are available on my site,
http://www.telegraphics.com.au/sw/

Don’t hesitate to contact me with any further questions.

–Toby

i.e. My file format does not show up in the OPEN dialog, and when I try to open I get a "wrong file type" error.
S
skahil
Jun 30, 2005
Thanks for the detailed answer Toby!
That gives me a lot to chew on.

You rock!
Sean.
S
skahil
Jun 30, 2005
Thanks for the detailed answer Toby!
That gives me a lot to chew on.

You rock!
Sean.

MacBook Pro 16” Mockups 🔥

– in 4 materials (clay versions included)

– 12 scenes

– 48 MacBook Pro 16″ mockups

– 6000 x 4500 px

Related Discussion Topics

Nice and short text about related topics in discussion sections