I've created a very, very simple File Format Plugin named TrivialFormatPlugin which creates a 1x1 single, 8bit channel image to the photoshop host. The source code is below. The problem is that whenever I call advanceState(), I get returned an error: formatBadParameters. I have no idea why and have tried many many different settings combinations but to no avail. If anyone has any advice I would greatly appreciate it. Thank you!<br /><br /><code><br />void TrivialFormatPlugin::ReadStart(void)<br />{<br /> formatRecord->imageMode = plugInModeGrayScale;<br /> formatRecord->depth = 8;<br /> formatRecord->imageSize.h = static_cast<short>( 1 );<br /> formatRecord->imageSize.v = static_cast<short>( 1 );<br /> formatRecord->planes = static_cast<int16>( 1 );<br /> <br /> //read whole image in at once<br /> uint32 bufferSize = static_cast<uint32>( 1 );<br /> BufferID bufferId;<br /> OSErr allocationStatus = <br /> formatRecord->bufferProcs->allocateProc( bufferSize, &bufferId );<br /> Ptr dataBuffer = formatRecord->bufferProcs->lockProc( bufferId, false );<br /> dataBuffer[0] = 127;<br /> formatRecord->data = dataBuffer;<br /> OSErr hostErr = formatRecord->advanceState();<br /> if( hostErr != noErr ) {<br /> LOG_DEBUG << "Error returned from advanceState() call:" <br /> << hostErr << " quitting.\n";<br /> }<br /> formatRecord->bufferProcs->unlockProc( bufferId );<br /> formatRecord->bufferProcs->freeProc( bufferId );<br /> formatRecord->data = 0;<br />}<br /></code>