The patch adds an important piece to library - support of image thumbnail, which finally makes sense because of header only loading!
Implemented so far are loading for jpeg (exif thumbnail), psd, and tga. Saving for tga only.
Supplied is also a test case. Here are some test files:
http://www.megafileupload.com/en/file/255597/ThumbnailTest-zip.html
For tga the patch also fixes the way channel order (BGR vs RGB) is handled when saving.
Anonymous
I forgot to mention that
DLL_API FIBITMAP* DLL_CALLCONV FreeImage_GetThumbnail(FIBITMAP *dib);
DLL_API void DLL_CALLCONV FreeImage_SetThumbnail(FIBITMAP dib, FIBITMAP thumb);
must be added to freeimage.h
Added EXR (incl header only loading)
Updated testcase
Samles:
http://download.savannah.nongnu.org/releases/openexr/openexr-images-1.5.0.tar.gz
Test images with JFIF Thumbanil
Added Jpeg loading and saving of JFIF Thumbnail.
(Note that exif thumb loading is still there and will overwrite the JFIF one)
Exif thumb will be saved to JFIF automatically.
Also there is new flag
JPEG_BASELINE 0x40000 // save basic JPEG, without metadata or any markers additional markers (APPn, COM, etc.) (use | to combine with other save flags)
It is used (and useful) for writing a minimal jpeg stream.
(required by thumbnails specifications (both exif and jfif))
Mihail,
Can you provide your patches using the CVS as a base source ?
For example, the VS C++ corrections added to PSDParser.cpp are no longer present. Idem for Exif.cpp and the fix for PENTAX Optio 230.
Note also that Utilities.h now contains new functions.
Ok, tomorrow.
(The new PluginJPEG.cpp is in sync though)
Jpeg (exif and jfif), tga, psd, exr thumbanil support (10-8-10 CVS sync)
Updated the code to match CVS. (hope have not missed something)
Two side notes:
CloseMemory must check for null stream.
RemoveAlphaLayer should be RemoveAlphaChannel. Otherwise it is quite confusing.
Loading and Saving TIFF thumbnail
Added TIFF loading and saving for thumbanil.
(It test tree possible locations exif ifd1, subIFD, and psd private tag)
Included is also a slightly modified psd parser in order to use it for the psd private tag loading.
The actual thumbnail definition
Forgot the link to some tiff thest images (one with exif and one with psd thumb)
http://www.megafileupload.com/en/file/259153/ThumbTestImagesTIFF-zip.html
Updated, yet again, test case
Hi Mihail,
I've merged your patches to the CVS for Exif, JPEG, EXR, PSD and TGA formats (TIF format still need to be added).
I have made one noticeable change to your code : FreeImage_SetThumbnail clone the thumbnail and FreeImage_Unload manage its destruction, instead of having a link to an external dib.
I've made extensive tests looking for possible memory leaks and all seems OK with the CVS code.
The C++ wrapper is also updated with 4 new functions.
Hervé
TIFF plugin completed ...
As there's no other plugin supporting thumbnails, I will close this patch entry.
To Mihail, many thanks for this work :)
I have also documented the new functions FreeImage_GetThumbnail / FreeImage_SetThumbnail for the next release documentation.
I don't know if FI users will use this feature but I just know that FreeImage is the only one library supporting this !
Hervé
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).