Exiv2::ExifThumb Class Reference

Access and modify an Exif thumbnail image. This class implements manipulators to set and erase the thumbnail image that is optionally embedded in IFD1 of the Exif data. Accessors are provided by the base class, ExifThumbC. More...

#include <exif.hpp>

Inheritance diagram for Exiv2::ExifThumb:

Public Member Functions

Creators
 ExifThumb (ExifData &exifData)
 Constructor.
 
- Public Member Functions inherited from Exiv2::ExifThumbC
 ExifThumbC (const ExifData &exifData)
 Constructor.
 
DataBuf copy () const
 Return the thumbnail image in a DataBuf. The caller owns the data buffer and DataBuf ensures that it will be deleted.
 
const char * mimeType () const
 Return the MIME type of the thumbnail, either "image/tiff" or "image/jpeg".
 
const char * extension () const
 Return the file extension for the format of the thumbnail (".tif" or ".jpg").
 

Manipulators

void setJpegThumbnail (const byte *buf, size_t size, URational xres, URational yres, uint16_t unit)
 Set the Exif thumbnail to the JPEG image pointed to by buf, and size size. Set XResolution, YResolution and ResolutionUnit to xres, yres and unit, respectively. More...
 
void setJpegThumbnail (const byte *buf, size_t size)
 Set the Exif thumbnail to the JPEG image pointed to by buf, and size size. More...
 
void erase ()
 Delete the thumbnail from the Exif data. Removes all Exif.Thumbnail.*, i.e., Exif IFD1 tags.
 

Detailed Description

Access and modify an Exif thumbnail image. This class implements manipulators to set and erase the thumbnail image that is optionally embedded in IFD1 of the Exif data. Accessors are provided by the base class, ExifThumbC.

Note
Various other preview and thumbnail images may be contained in an image, depending on its format and the camera make and model. This class only provides access to the Exif thumbnail as specified in the Exif standard.

Member Function Documentation

◆ setJpegThumbnail() [1/2]

void Exiv2::ExifThumb::setJpegThumbnail ( const byte buf,
size_t  size 
)

Set the Exif thumbnail to the JPEG image pointed to by buf, and size size.

This sets only the Compression, JPEGInterchangeFormat and JPEGInterchangeFormatLength tags, which is not all the thumbnail Exif information mandatory according to the Exif standard. (But it's enough to work with the thumbnail.)

Note
No checks on the image format or size are performed.
Additional existing Exif thumbnail tags are not modified.

◆ setJpegThumbnail() [2/2]

void Exiv2::ExifThumb::setJpegThumbnail ( const byte buf,
size_t  size,
URational  xres,
URational  yres,
uint16_t  unit 
)

Set the Exif thumbnail to the JPEG image pointed to by buf, and size size. Set XResolution, YResolution and ResolutionUnit to xres, yres and unit, respectively.

This results in the minimal thumbnail tags being set for a JPEG thumbnail, as mandated by the Exif standard.

Exceptions
Errorif reading the file fails.
Note
No checks on the image format or size are performed.
Additional existing Exif thumbnail tags are not modified.
The JPEG image inserted as thumbnail image should not itself contain Exif data (or other metadata), as existing applications may have problems with that. (The preview application that comes with OS X for one.) - David Harvey.

The documentation for this class was generated from the following file: