Hello again,
nexes300 wrote:
>
>
> Hello,
>
> About this issue, I have gotten JPEGs to display within filemaker from a
> container field,
Good to hear you got it working. What was the issue, if you don't mind
me asking?
> however PNG only shows up as an icon still. From what I've read in the
> comments in the
> binary data header file, it appears that a JPEG stream is required for
> all pictures. Is this
> true, and if so is this because the JPEG stream is used as a preview?
The JPEG stream is used as the preview image for all image formats that
filemaker can't natively display. Filemaker tells you that it can
display JPEG and GIF images natively and that everything else has to
have a JPEG version of it created in order to be displayed. However, it
will display PNGs (and some other image formats I believe) if you insert
an empty JPEG stream. (ie. MyBinaryData->Add(*fmx::QuadCharAutoPtr('J',
'P', 'E', 'G'), 0, NULL); )
Another thing to note is that, for some reason, Instant Web Publishing
will only display the JPEG preview and will never show the PNG. (In my
testing anyway .. if someone knows how to make Instant Web Publishing
display a PNG, please let me know.)
>
> If it is not true, then how do I properly construct the binary so that
> it displays correctly in
> Filemaker when returned by the plugin function?
>
> Also, why is the SIZE stream required? Is there a way to have filemaker
> automatically
> determine the correct sizing? Or will I have to use another image
> library to determine the
> correct size?
Unfortunately, it is required. It would be nice if FileMaker at least
provided a function for generating the SIZE stream from an image (seeing
how their own code does it if you "Insert" a picture from the UI) but
for now you will need to determine the size yourself. It's possible to
write some quick and dirty code to extract those values yourself out of
at least gif and jpeg images. (For example, the GIF width and height
are WORD values at 6 and 8 bytes in from the beginning of the file.) Of
course, if you are generating these images yourself, you should know how
big they are.
>
> Sorry for having so many questions but there isn't very much
> documentation about this.
> Any help would be appreciated.
>
> Thanks!
>
> Charles
>
I hope this helps,
Jake
--
Jake Traynham
Owner, CNS Plug-ins
http://www.cnsplug-ins.com/