Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

formatBadParameters

New Here ,
Apr 09, 2007 Apr 09, 2007

Copy link to clipboard

Copied

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>
TOPICS
SDK

Views

340
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Participant ,
Apr 09, 2007 Apr 09, 2007

Copy link to clipboard

Copied

I could help you if you were using C (much source code for format plugins in C is on my site).

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 10, 2007 Apr 10, 2007

Copy link to clipboard

Copied

LATEST
Thank you for the offer but I think I've finally figured out my problems (or at least two of the major ones):

1) Do not call advanceState() from ReadStart(). Instead use it inside ReadContinue(). I had thought the documentation was pretty clear that ReadContinue() was deprecated and that you were supposed to merge all the functionality into ReadStart(). Either the docs are wrong or I misread them.

2) theRect.bottom needs to be a greater number than theRect.top. I had these two values reversed and my images were just coming out as all white. Too bad for me that I didn't include the lines that set theRect in the code snippet I included. Perhaps someone would have caught this before I did. Oh well.

Rob

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines