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

Stateless parser class for IPTC data. Images use this class to decode and encode binary IPTC data. More...

`#include <iptc.hpp>`

## Static Public Member Functions

static int | decode (IptcData &iptcData, const byte *pData, uint32_t size)
| Decode binary IPTC data in IPTC IIM4 format from a buffer pData of length size to the provided metadata container.
static DataBuf | encode (const IptcData &iptcData)
| Encode the IPTC datasets from iptcData to a binary representation in IPTC IIM4 format.

## Detailed Description

Stateless parser class for IPTC data. Images use this class to decode and encode binary IPTC data.

## Member Function Documentation

## decode()

int Exiv2::IptcParser::decode | ( | IptcData & | iptcData,
|  | const byte * | pData,
|  | uint32_t | size
| ) |  |

static

Decode binary IPTC data in IPTC IIM4 format from a buffer pData of length size to the provided metadata container.

Parameters

  iptcData | Metadata container to add the decoded IPTC datasets to.
  pData | Pointer to the data buffer to read from.
  size | Number of bytes in the data buffer.

Returns
  0 if successful;
  5 if the binary IPTC data is invalid or corrupt

References Exiv2::IptcData::clear(), EXV_WARNING, and Exiv2::getUShort().

Referenced by Exiv2::Internal::TiffDecoder::decodeIptc(), Exiv2::Jp2Image::readMetadata(), and Exiv2::JpegBase::readMetadata().

## encode()

DataBuf Exiv2::IptcParser::encode | ( | const IptcData & | iptcData | ) |

static

Encode the IPTC datasets from iptcData to a binary representation in IPTC IIM4 format.

Convert the IPTC datasets to binary format and return it. Caller owns the returned buffer. The copied data follows the IPTC IIM4 standard.

Returns
  Data buffer containing the binary IPTC data in IPTC IIM4 format.

References Exiv2::IptcData::begin(), Exiv2::IptcData::end(), Exiv2::DataBuf::pData_, Exiv2::IptcData::size(), Exiv2::ul2Data(), and Exiv2::us2Data().

Referenced by Exiv2::Photoshop::setIptcIrb().

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

- iptc.hpp
- iptc.cpp