Performing back-to-back write/read tests through the library, writing a FIF_GIF creates a corrupt file. Upon attempted readback, the error "EOF reading Logical Screen Descriptor" is thrown.
format = FIT_BITMAP
BPP = 24;
(all local code checked out by reading/writing to other formats).
Hi,
First, note that the GIF format does not support 24-bit formats.
You should see an error message when using FreeImage_SetOutputMessage and FreeImage_Save should return NULL.
Now I don't understand how you managed to save a 24-bit dib as GIF using FreeImage (note: your sample file is not a GIF file, just edit it with a text editor to see this).
Can you show me a sample code ?
Hervé
Hi Herve,
Thanks for the fast response on this!
Apologies for the muck-up: I made the assumption 8bits meant 8bits per channel (x3 = 24bit)!
To get to the point of saving, I did:
a). FreeImage_AllocateT(FIF_BITMAP, x, y, 24);
b). used FreeImage_GetBits() to populate bitmap ([FI_RGBA_RED], etc)
c). performed the following write function:
bool ImageWriter(FIBITMAP bmp, const char lpszPathName, FIF_GIF,GIF_DEFAULT)
{
FREE_IMAGE_TYPE itype = FreeImage_GetImageType(bmp);
}
The writer returns true.
Let me know if you need any more detail.
cheers, and thanks for your hard work!
Mat
Hi,
The correct test should be someting like this
See also FreeImage_FIFSupportsWriting in the PDF doc.
Hervé
Last edit: Hervé Drolon 2015-08-28
Closed in release 3.18.0
Please open a new bug if your problem persist.