-
1. Re: Format Plug-In : problem loading a 4 channels image with CS4
G_Soucy May 26, 2009 10:07 AM (in response to G_Soucy)Some update on that problem: it happens only with CS4. I tried CS2 and CS3 (version 10.0) and they all work fine (i.e. the demo format plugin in SDK CS4 "simpleformat" can load a 4 channel image no problem). Strange that the CS4 demo program works with all versions except CS4.
I have a feeling that it is related to Smart Objects. Anybody has a clue?
Thanks!
-
2. Re: Format Plug-In : problem loading a 4 channels image with CS4
G_Soucy May 26, 2009 11:37 AM (in response to G_Soucy)/*****************************************************************************/
static
void DoReadFinish (void)
{
/* Test the ability to create the file inside a smart object */
/* This flag also tells you which menu item was selected */
// if openAsSmartObject is already true then you cannot turn it off
gFormatRecord->openAsSmartObject = gData->openAsSmartObject;
// every other time we open as smart, that should be confusing enough for a user!
gData->openAsSmartObject = !gData->openAsSmartObject;
/* Dispose of the image resource data if it exists. */
DisposeImageResources ();
WriteScriptParamsOnRead (); // should be different for read/write
AddComment (); // write a history comment
}
Found the problem: the routine DoReadFinish() in SimpleFormat.cpp ( sample file format plug-in in SDK for CS4) has the routine DoReadFinish() as shown above. I just needed to delete the 2 lines related to smart object. Everything works fine after that. I had overlooked that routine a bit I suppose but those 2 lines do not add much to the undestanding othe plug-in mechanism and they should be deleted from the example IMHO.

