Loading...
Searching...
No Matches
Exiv2::PreviewImage Class Reference

Class that holds preview image properties and data buffer. More...

`#include <preview.hpp>`

## Public Member Functions

Constructors
| PreviewImage (const PreviewImage &rhs)
| Copy constructor.
Manipulators
PreviewImage & | operator= (const PreviewImage &rhs)
| Assignment operator.

## Friends

class | PreviewManager

## Accessors

DataBuf | copy () const
| Return a copy of the preview image data. The caller owns this copy and DataBuf ensures that it will be deleted.
const byte * | pData () const
| Return a pointer to the image data for read-only access.
uint32_t | size () const
| Return the size of the preview image in bytes.
size_t | writeFile (const std::string &path) const
| Write the thumbnail image to a file.
std::string | mimeType () const
| Return the MIME type of the preview image, usually either `"image/tiff"` or `"image/jpeg"`.
std::string | extension () const
| Return the file extension for the format of the preview image (".tif" or ".jpg").
size_t | width () const
| Return the width of the preview image in pixels.
size_t | height () const
| Return the height of the preview image in pixels.
PreviewId | id () const
| Return the preview image type identifier.

## Detailed Description

Class that holds preview image properties and data buffer.

## Member Function Documentation

## writeFile()

size_t Exiv2::PreviewImage::writeFile | ( | const std::string & | path | ) | const

nodiscard

Write the thumbnail image to a file.

A filename extension is appended to path according to the image type of the preview image, so path should not include an extension. The function will overwrite an existing file of the same name.

Parameters

  path | File name of the preview image without extension.

Returns
  The number of bytes written.

References extension(), height(), id(), mimeType(), PreviewImage(), and width().

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

- preview.hpp
- preview.cpp