Menu ▾ ▴

#56 Thumbnail support

closed
None
5
2012-10-31
2010-08-01
No

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.

Discussion

  • Mihail Naydenov

    Mihail Naydenov - 2010-08-01

    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

     
  • Mihail Naydenov

    Mihail Naydenov - 2010-08-09

    Test images with JFIF Thumbanil

     
  • Mihail Naydenov

    Mihail Naydenov - 2010-08-09

    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))

     
  • Hervé Drolon

    Hervé Drolon - 2010-08-09

    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.

     
  • Mihail Naydenov

    Mihail Naydenov - 2010-08-09

    Ok, tomorrow.
    (The new PluginJPEG.cpp is in sync though)

     
  • Mihail Naydenov

    Mihail Naydenov - 2010-08-10

    Jpeg (exif and jfif), tga, psd, exr thumbanil support (10-8-10 CVS sync)

     
  • Mihail Naydenov

    Mihail Naydenov - 2010-08-10

    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.

     
  • Mihail Naydenov

    Mihail Naydenov - 2010-08-13

    Loading and Saving TIFF thumbnail

     
  • Mihail Naydenov

    Mihail Naydenov - 2010-08-13

    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.

     
  • Mihail Naydenov

    Mihail Naydenov - 2010-08-13

    The actual thumbnail definition

     
  • Mihail Naydenov

    Mihail Naydenov - 2010-08-13

    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

     
  • Mihail Naydenov

    Mihail Naydenov - 2010-08-13

    Updated, yet again, test case

     
  • Hervé Drolon

    Hervé Drolon - 2010-11-14

    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é

     
  • Hervé Drolon

    Hervé Drolon - 2010-11-21

    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é

     
  • SourceForge Robot

    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).

     

Anonymous
Anonymous

Add attachments
Cancel