Loading ...
Sorry, an error occurred while loading the content.
 

Accessing preview images

Expand Messages
  • Andreas Huggel
    RAW images may contain several (I ve seen up to three) preview images in addition to the main image in different sizes and usually in JPEG or TIFF format.
    Message 1 of 1 , Oct 16, 2008
      RAW images may contain several (I've seen up to three) preview images
      in addition to the main image in different sizes and usually in JPEG
      or TIFF format.

      Applications can use these to very quickly display a thumbnail or
      lower resolution preview of the actual picture (which is typically
      large and may require decoding before it can be displayed).

      For the 0.18 release, Vladimir Nadvornik has contributed new Exiv2
      functionality to easily access a list of available preview images as
      well as the actual preview images from the metadata of the image
      (Exif, IPTC or XMP). It works roughly like this:

      Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(filename);
      image->readMetadata();

      Exiv2::PreviewManager loader(*image);
      Exiv2::PreviewPropertiesList list = loader.getPreviewProperties();
      // The list is sorted by the size (in pixels) of the previews,
      // starting with the smallest preview.

      // Choose one of the previews from the list ...
      Exiv2::PreviewImage preview = loader.getPreviewImage(*pos);

      // PreviewImage has methods to access the preview image data

      The feature is in the SVN trunk (preview.hpp) and works well enough
      that you can try it out and let us know what you think of it now.

      Andreas
    Your message has been successfully submitted and will be delivered to recipients shortly.