Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Examples

Exiv2::JpegThumbnail Class Reference

Exif thumbnail image in JPEG format. More...

#include <exif.hpp>

Inheritance diagram for Exiv2::JpegThumbnail:

Inheritance graph
[legend]
Collaboration diagram for Exiv2::JpegThumbnail:

Collaboration graph
[legend]
List of all members.

Public Member Functions

Creators
 JpegThumbnail ()
 Virtual destructor.
virtual ~JpegThumbnail ()
 Virtual destructor.
 JpegThumbnail (const JpegThumbnail &rhs)
 Copy constructor.
Manipulators
JpegThumbnailoperator= (const JpegThumbnail &rhs)
 Assignment operator.
int read (const byte *buf, long len, const ExifData &exifData, ByteOrder byteOrder=littleEndian)
 Read the thumbnail from the data buffer buf, using Exif metadata exifData. Return 0 if successful.
void setOffsets (Ifd &ifd1, ByteOrder byteOrder)
 Update the internal offset and the thumbnail data offsets in IFD1 assuming the thumbnail data follows immediately after IFD1.
Accessors
int write (const std::string &path) const
 Write thumbnail to file path.
const char * format () const
 Return a short string for the format of the thumbnail ("TIFF", "JPEG").
const char * extension () const
 Return the file extension for the format of the thumbnail (".tif", ".jpg").
long copy (byte *buf) const
 Copy the thumbnail image data (without the IFD, if any) to the data buffer buf. The user must ensure that the buffer has enough memory. Otherwise the call results in undefined behaviour. Return the number of characters written.
void update (ExifData &exifData) const
 Update the Exif data according to the actual thumbnail image.
long offset () const
 Return the position of the thumbnail image data from the start of the TIFF header in the original Exif data.
long size () const
 Return the size of the thumbnail image (the size it would occupy when extracted from the Exif data).
long dataSize () const
 Return the size of the thumbnail data (data only, without the IFD, in case of a TIFF thumbnail).

Detailed Description

Exif thumbnail image in JPEG format.


Member Function Documentation

int Exiv2::JpegThumbnail::read const byte buf,
long  len,
const ExifData exifData,
ByteOrder  byteOrder = littleEndian
[virtual]
 

Read the thumbnail from the data buffer buf, using Exif metadata exifData. Return 0 if successful.

Parameters:
buf Data buffer containing the thumbnail data. The buffer must start with the TIFF header.
len Number of bytes in the data buffer.
exifData Exif data corresponding to the data buffer.
byteOrder The byte order used for the encoding of TIFF thumbnails. It determines the byte order of the resulting thumbnail image, if it is in TIFF format. For JPEG thumbnails the byte order is not used.
Returns:
0 if successful
-1 if there is no thumbnail image in the Exif data
1 in case of inconsistent JPEG thumbnail Exif data
2 in case of inconsistent TIFF thumbnail Exif data

Implements Exiv2::Thumbnail.

void Exiv2::JpegThumbnail::setOffsets Ifd ifd1,
ByteOrder  byteOrder
[virtual]
 

Update the internal offset and the thumbnail data offsets in IFD1 assuming the thumbnail data follows immediately after IFD1.

If the type of the thumbnail image is JPEG, JPEGInterchangeFormat is set to point directly behind the data area of IFD1. If the type is TIFF, StripOffsets from the thumbnail image are adjusted to point to the strips, which have to follow immediately after IFD1. Use copy() to write the thumbnail image data. The offset of IFD1 must be set correctly. Changing the size or data size of IFD1 invalidates the thumbnail data offsets set by this method.

Implements Exiv2::Thumbnail.

void Exiv2::JpegThumbnail::update ExifData exifData  )  const [virtual]
 

Update the Exif data according to the actual thumbnail image.

If the type of the thumbnail image is JPEG, JPEGInterchangeFormat is set to 0. If the type is TIFF, StripOffsets are set to the offsets of the IFD of the thumbnail image itself.

Implements Exiv2::Thumbnail.

int Exiv2::JpegThumbnail::write const std::string &  path  )  const [virtual]
 

Write thumbnail to file path.

Returns:
0 if successful;
-1 if the file couldn't be open;
4 if writing to the output stream failed.

Implements Exiv2::Thumbnail.


The documentation for this class was generated from the following files:
Generated on Mon Sep 13 22:01:42 2004 for Exiv2 by doxygen 1.3.8