Exiv2
jpgimage.hpp
Go to the documentation of this file.
1 // ***************************************************************** -*- C++ -*-
2 /*
3  * Copyright (C) 2004-2018 Exiv2 authors
4  * This program is part of the Exiv2 distribution.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA.
19  */
33 #ifndef JPGIMAGE_HPP_
34 #define JPGIMAGE_HPP_
35 
36 // *****************************************************************************
37 #include "exiv2lib_export.h"
38 
39 // included header files
40 #include "image.hpp"
41 
42 // *****************************************************************************
43 // namespace extensions
44 namespace Exiv2 {
45 
46 // *****************************************************************************
47 // class definitions
48 
49  // Supported JPEG image formats
50  namespace ImageType {
51  const int jpeg = 1;
52  const int exv = 2;
53  }
54 
59  struct EXIV2API Photoshop {
60  // Todo: Public for now
61  static const char ps3Id_[];
62  static const char* irbId_[];
63  static const char bimId_[];
64  static const uint16_t iptc_;
65  static const uint16_t preview_;
66 
75  static bool isIrb(const byte* pPsData,
76  long sizePsData);
85  static bool valid(const byte* pPsData,
86  long sizePsData);
104  static int locateIrb(const byte *pPsData,
105  long sizePsData,
106  uint16_t psTag,
107  const byte **record,
108  uint32_t *const sizeHdr,
109  uint32_t *const sizeData);
113  static int locateIptcIrb(const byte *pPsData,
114  long sizePsData,
115  const byte **record,
116  uint32_t *const sizeHdr,
117  uint32_t *const sizeData);
121  static int locatePreviewIrb(const byte *pPsData,
122  long sizePsData,
123  const byte **record,
124  uint32_t *const sizeHdr,
125  uint32_t *const sizeData);
135  static DataBuf setIptcIrb(const byte* pPsData,
136  long sizePsData,
137  const IptcData& iptcData);
138 
139  }; // class Photoshop
140 
144  class EXIV2API JpegBase : public Image {
145  public:
147 
148  void readMetadata();
149  void writeMetadata();
150 
157  void printStructure(std::ostream& out, PrintStructureOption option,int depth);
159 
160  protected:
162 
163 
181  JpegBase(int type,
182  BasicIo::AutoPtr io,
183  bool create,
184  const byte initData[],
185  long dataSize);
187 
189 
190 
209  virtual bool isThisType(BasicIo& iIo, bool advance) const =0;
211 
213 
214 
220  virtual int writeHeader(BasicIo& oIo) const =0;
222 
223  // Constant Data
224  static const byte dht_;
225  static const byte dqt_;
226  static const byte dri_;
227  static const byte sos_;
228  static const byte eoi_;
229  static const byte app0_;
230  static const byte app1_;
231  static const byte app2_;
232  static const byte app13_;
233  static const byte com_;
234  static const byte sof0_;
235  static const byte sof1_;
236  static const byte sof2_;
237  static const byte sof3_;
238  static const byte sof5_;
239  static const byte sof6_;
240  static const byte sof7_;
241  static const byte sof9_;
242  static const byte sof10_;
243  static const byte sof11_;
244  static const byte sof13_;
245  static const byte sof14_;
246  static const byte sof15_;
247  static const char exifId_[];
248  static const char jfifId_[];
249  static const char xmpId_[];
250  static const char iccId_[];
251 
252  private:
254 
255  JpegBase();
258  JpegBase(const JpegBase& rhs);
260  JpegBase& operator=(const JpegBase& rhs);
262 
264 
265 
272  int initImage(const byte initData[], long dataSize);
280  void doWriteMetadata(BasicIo& oIo);
282 
284 
285 
293  int advanceToMarker() const;
295 
296  }; // class JpegBase
297 
301  class EXIV2API JpegImage : public JpegBase {
302  friend EXIV2API bool isJpegType(BasicIo& iIo, bool advance);
303  public:
305 
306 
321  JpegImage(BasicIo::AutoPtr io, bool create);
323 
325  std::string mimeType() const;
327 
328  protected:
330 
331  bool isThisType(BasicIo& iIo, bool advance) const;
333 
335 
343  int writeHeader(BasicIo& oIo) const;
345 
346  private:
347  // Constant data
348  static const byte soi_; // SOI marker
349  static const byte blank_[]; // Minimal Jpeg image
350 
351  // NOT Implemented
353  JpegImage();
355  JpegImage(const JpegImage& rhs);
357  JpegImage& operator=(const JpegImage& rhs);
358 
359  }; // class JpegImage
360 
362  class EXIV2API ExvImage : public JpegBase {
363  friend EXIV2API bool isExvType(BasicIo& iIo, bool advance);
364  public:
366 
367 
382  ExvImage(BasicIo::AutoPtr io, bool create);
384 
386  std::string mimeType() const;
388 
389  protected:
391 
392  bool isThisType(BasicIo& iIo, bool advance) const;
394 
396  int writeHeader(BasicIo& oIo) const;
398 
399  private:
400  // Constant data
401  static const char exiv2Id_[]; // EXV identifier
402  static const byte blank_[]; // Minimal exiv2 file
403 
404  // NOT Implemented
406  ExvImage();
408  ExvImage(const ExvImage& rhs);
410  ExvImage& operator=(const ExvImage& rhs);
411 
412  }; // class ExvImage
413 
414 // *****************************************************************************
415 // template, inline and free functions
416 
417  // These could be static private functions on Image subclasses but then
418  // ImageFactory needs to be made a friend.
424  EXIV2API Image::AutoPtr newJpegInstance(BasicIo::AutoPtr io, bool create);
426  EXIV2API bool isJpegType(BasicIo& iIo, bool advance);
432  EXIV2API Image::AutoPtr newExvInstance(BasicIo::AutoPtr io, bool create);
434  EXIV2API bool isExvType(BasicIo& iIo, bool advance);
435 
436 } // namespace Exiv2
437 
438 #endif // #ifndef JPGIMAGE_HPP_
Exiv2::JpegBase::com_
static const byte com_
JPEG Comment marker.
Definition: jpgimage.hpp:233
image_int.hpp
Internal image helpers.
Exiv2::MemIo
Provides binary IO on blocks of memory by implementing the BasicIo interface. A copy-on-write impleme...
Definition: basicio.hpp:540
Exiv2::ExifData::clear
void clear()
Delete all Exifdatum instances resulting in an empty container. Note that this also removes thumbnail...
Definition: exif.cpp:587
Exiv2::Photoshop::preview_
static const uint16_t preview_
Photoshop preview marker
Definition: jpgimage.hpp:65
Exiv2::JpegImage::isJpegType
friend EXIV2API bool isJpegType(BasicIo &iIo, bool advance)
Check if the file iIo is a JPEG image.
Definition: jpgimage.cpp:1361
Exiv2::ImageType::xmp
const int xmp
XMP sidecar files (see class XmpSidecar)
Definition: xmpsidecar.hpp:45
Exiv2::JpegBase::sof3_
static const byte sof3_
JPEG Start-Of-Frame marker.
Definition: jpgimage.hpp:237
Exiv2::Image::xmpPacket_
std::string xmpPacket_
XMP packet.
Definition: image.hpp:493
Exiv2::BasicIo::isopen
virtual bool isopen() const =0
Returns true if the IO source is open, otherwise false.
Exiv2::ImageType::exv
const int exv
EXV image type (see class ExvImage)
Definition: jpgimage.hpp:52
Exiv2::BasicIo::error
virtual int error() const =0
Returns 0 if the IO source is in a valid state, otherwise nonzero.
Exiv2::DataBuf::pData_
byte * pData_
Pointer to the buffer, 0 if none has been allocated.
Definition: types.hpp:269
Exiv2::Image::iptcData_
IptcData iptcData_
IPTC data container.
Definition: image.hpp:489
Exiv2::JpegBase::dht_
static const byte dht_
JPEG DHT marker.
Definition: jpgimage.hpp:224
Exiv2::JpegBase::dqt_
static const byte dqt_
JPEG DQT marker.
Definition: jpgimage.hpp:225
Exiv2::JpegBase::writeMetadata
void writeMetadata()
Write metadata back to the image.
Definition: jpgimage.cpp:901
Exiv2::IoCloser
Utility class that closes a BasicIo instance upon destruction. Meant to be used as a stack variable i...
Definition: basicio.hpp:264
Exiv2::Photoshop::locateIrb
static int locateIrb(const byte *pPsData, long sizePsData, uint16_t psTag, const byte **record, uint32_t *const sizeHdr, uint32_t *const sizeData)
Locates the data for a Photoshop tag in a Photoshop formated memory buffer. Operates on raw data to s...
Definition: jpgimage.cpp:142
Exiv2::JpegBase::isThisType
virtual bool isThisType(BasicIo &iIo, bool advance) const =0
Determine if the content of the BasicIo instance is of the type supported by this class.
Exiv2::Uint32Vector
std::vector< uint32_t > Uint32Vector
typedef for uint32_t vector
Definition: datasets.hpp:403
Exiv2::JpegBase::app2_
static const byte app2_
JPEG APP2 marker.
Definition: jpgimage.hpp:231
Exiv2::JpegBase::app13_
static const byte app13_
JPEG APP13 marker.
Definition: jpgimage.hpp:232
Exiv2::JpegBase::sof0_
static const byte sof0_
JPEG Start-Of-Frame marker.
Definition: jpgimage.hpp:234
Exiv2::XmpParser::omitAllFormatting
@ omitAllFormatting
Omit all formatting whitespace.
Definition: xmp_exiv2.hpp:285
Exiv2::Image::comment_
std::string comment_
User comment.
Definition: image.hpp:492
Exiv2::IptcParser::decode
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 metada...
Definition: iptc.cpp:432
Exiv2::JpegBase::app0_
static const byte app0_
JPEG APP0 marker.
Definition: jpgimage.hpp:229
Exiv2::Photoshop::locateIptcIrb
static int locateIptcIrb(const byte *pPsData, long sizePsData, const byte **record, uint32_t *const sizeHdr, uint32_t *const sizeData)
Forwards to locateIrb() with psTag = iptc_.
Definition: jpgimage.cpp:219
Exiv2::JpegBase::printStructure
void printStructure(std::ostream &out, PrintStructureOption option, int depth)
Print out the structure of image file.
Definition: jpgimage.cpp:577
Exiv2::JpegBase::sof14_
static const byte sof14_
JPEG Start-Of-Frame marker.
Definition: jpgimage.hpp:245
Exiv2::isExvType
EXIV2API bool isExvType(BasicIo &iIo, bool advance)
Check if the file iIo is an EXV file.
Definition: jpgimage.cpp:1413
Exiv2::makeSlice
Slice< T > makeSlice(T &cont, size_t begin, size_t end)
Return a new slice with the given bounds.
Definition: slice.hpp:673
Exiv2::JpegBase::sof6_
static const byte sof6_
JPEG Start-Of-Frame marker.
Definition: jpgimage.hpp:239
Exiv2::Image::comment
virtual std::string comment() const
Return a copy of the image comment. May be an empty string.
Definition: image.cpp:713
Exiv2::JpegBase::app1_
static const byte app1_
JPEG APP1 marker.
Definition: jpgimage.hpp:230
Exiv2::strError
EXIV2API std::string strError()
Return a system error message and the error code (errno). See strerror(3).
Definition: futils.cpp:352
Exiv2::ExvImage::mimeType
std::string mimeType() const
Return the MIME type of the image.
Definition: jpgimage.cpp:1383
Exiv2::JpegBase::exifId_
static const char exifId_[]
Exif identifier.
Definition: jpgimage.hpp:247
Exiv2::Image::exifData_
ExifData exifData_
Exif data container.
Definition: image.hpp:488
Exiv2::JpegBase::sof5_
static const byte sof5_
JPEG Start-Of-Frame marker.
Definition: jpgimage.hpp:238
Exiv2::Internal::binaryToString
binaryToStringHelper< T > binaryToString(const Slice< T > sl)
format binary data for display in Image::printStructure()
Definition: image_int.hpp:125
string_from_unterminated
std::string string_from_unterminated(const char *data, size_t data_length)
Convert a (potentially not null terminated) array into a std::string.
Definition: helper_functions.cpp:33
Exiv2::IptcData::clear
void clear()
Delete all Iptcdatum instances resulting in an empty container.
Definition: iptc.hpp:218
Exiv2::Image::iccProfileDefined
virtual bool iccProfileDefined()
Erase iccProfile. the profile is not removed from the actual image until the writeMetadata() method i...
Definition: image.hpp:238
Exiv2::Image::pixelHeight_
int pixelHeight_
image pixel height
Definition: image.hpp:495
Exiv2::Photoshop::valid
static bool valid(const byte *pPsData, long sizePsData)
Validates all IRBs.
Definition: jpgimage.cpp:122
Exiv2::newJpegInstance
EXIV2API Image::AutoPtr newJpegInstance(BasicIo::AutoPtr io, bool create)
Create a new JpegImage instance and return an auto-pointer to it. Caller owns the returned object and...
Definition: jpgimage.cpp:1352
Exiv2::Image::clearMetadata
virtual void clearMetadata()
Erase all buffered metadata. Metadata is not removed from the actual image until the writeMetadata() ...
Definition: image.cpp:541
Exiv2::Uint32Vector_i
Uint32Vector::const_iterator Uint32Vector_i
typedef for Uint32Vector iterator
Definition: datasets.hpp:411
Exiv2::JpegBase::sof9_
static const byte sof9_
JPEG Start-Of-Frame marker.
Definition: jpgimage.hpp:241
enforce.hpp
Port of D's enforce() to C++ & Exiv2.
Exiv2::ExifParser::encode
static WriteMethod encode(Blob &blob, const byte *pData, uint32_t size, ByteOrder byteOrder, const ExifData &exifData)
Encode Exif metadata from the provided metadata to binary Exif format.
Definition: exif.cpp:644
Exiv2::newExvInstance
EXIV2API Image::AutoPtr newExvInstance(BasicIo::AutoPtr io, bool create)
Create a new ExvImage instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition: jpgimage.cpp:1405
Exiv2::Internal::stringFormat
std::string stringFormat(const char *format,...)
format a string in the pattern of sprintf .
Definition: image_int.cpp:32
Exiv2::Image::setByteOrder
void setByteOrder(ByteOrder byteOrder)
Set the byte order to encode the Exif metadata in.
Definition: image.cpp:678
Exiv2::hexdump
EXIV2API void hexdump(std::ostream &os, const byte *buf, long len, long offset=0)
Print len bytes from buf in hex and ASCII format to the given stream, prefixed with the position in t...
Definition: types.cpp:518
Exiv2::Image::byteOrder
ByteOrder byteOrder() const
Return the byte order in which the Exif metadata of the image is encoded. Initially,...
Definition: image.cpp:683
Exiv2::JpegImage::isThisType
bool isThisType(BasicIo &iIo, bool advance) const
Determine if the content of the BasicIo instance is of the type supported by this class.
Definition: jpgimage.cpp:1347
Exiv2::IptcData::printStructure
static void printStructure(std::ostream &out, const Slice< byte * > &bytes, uint32_t depth)
dump iptc formatted binary data (used by printStructure kpsRecursive)
Definition: iptc.cpp:351
Exiv2::append
EXIV2API void append(Exiv2::Blob &blob, const byte *buf, uint32_t len)
Append len bytes pointed to by buf to blob.
Definition: image.cpp:984
Exiv2::Image::pixelWidth_
int pixelWidth_
image pixel width
Definition: image.hpp:494
enforce
void enforce(bool condition, const T &arg1)
Ensure that condition is true, otherwise throw an exception of the type exception_t.
Definition: enforce.hpp:43
Exiv2::JpegBase::sof1_
static const byte sof1_
JPEG Start-Of-Frame marker.
Definition: jpgimage.hpp:235
Exiv2::ExvImage::writeHeader
int writeHeader(BasicIo &oIo) const
Writes the image header (aka signature) to the BasicIo instance.
Definition: jpgimage.cpp:1388
Exiv2::Image::printTiffStructure
void printTiffStructure(BasicIo &io, std::ostream &out, PrintStructureOption option, int depth, size_t offset=0)
Print out the structure of image file.
Definition: image.cpp:523
helper_functions.hpp
A collection of helper functions.
Exiv2::ExvImage::isThisType
bool isThisType(BasicIo &iIo, bool advance) const
Determine if the content of the BasicIo instance is of the type supported by this class.
Definition: jpgimage.cpp:1400
Exiv2::DataBuf
Utility class containing a character array. All it does is to take care of memory allocation and dele...
Definition: types.hpp:204
Exiv2::us2Data
EXIV2API long us2Data(byte *buf, uint16_t s, ByteOrder byteOrder)
Convert an unsigned short to data, write the data to the buffer, return number of bytes written.
Definition: types.cpp:395
Exiv2::JpegImage::writeHeader
int writeHeader(BasicIo &oIo) const
Writes a Jpeg header (aka signature) to the BasicIo instance.
Definition: jpgimage.cpp:1336
Exiv2::XmpParser::useCompactFormat
@ useCompactFormat
Use a compact form of RDF.
Definition: xmp_exiv2.hpp:281
Exiv2::JpegImage::mimeType
std::string mimeType() const
Return the MIME type of the image.
Definition: jpgimage.cpp:1331
Exiv2::BasicIo::putb
virtual int putb(byte data)=0
Write one byte to the IO source. Current IO position is advanced by one byte.
Exiv2::JpegBase::sof2_
static const byte sof2_
JPEG Start-Of-Frame marker.
Definition: jpgimage.hpp:236
Exiv2::XmpData::count
long count() const
Get the number of metadata entries.
Definition: xmp.cpp:370
Exiv2::DataBuf::size_
long size_
The current size of the buffer.
Definition: types.hpp:271
Exiv2::XmpParser::encode
static int encode(std::string &xmpPacket, const XmpData &xmpData, uint16_t formatFlags=useCompactFormat, uint32_t padding=0)
Encode (serialize) XMP metadata from xmpData into a string xmpPacket. The XMP packet returned in the ...
Definition: xmp.cpp:836
Exiv2::BasicIo::eof
virtual bool eof() const =0
Returns true if the IO position has reached the end, otherwise false.
Exiv2::find
const T * find(T(&src)[N], const K &key)
Find an element that matches key in the array src.
Definition: types.hpp:508
Exiv2::JpegBase::iccId_
static const char iccId_[]
ICC profile identifier.
Definition: jpgimage.hpp:250
Exiv2::BasicIo::read
virtual DataBuf read(long rcount)=0
Read data from the IO source. Reading starts at the current IO position and the position is advanced ...
Exiv2::ExifData::count
long count() const
Get the number of metadata entries.
Definition: exif.hpp:514
Exiv2::JpegImage
Class to access JPEG images.
Definition: jpgimage.hpp:301
Exiv2::JpegBase::eoi_
static const byte eoi_
JPEG EOI marker.
Definition: jpgimage.hpp:228
Exiv2
Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of ...
Definition: asfvideo.hpp:36
image.hpp
Exiv2::JpegBase::jfifId_
static const char jfifId_[]
JFIF identifier.
Definition: jpgimage.hpp:248
Exiv2::ul2Data
EXIV2API long ul2Data(byte *buf, uint32_t l, ByteOrder byteOrder)
Convert an unsigned long to data, write the data to the buffer, return number of bytes written.
Definition: types.cpp:408
Exiv2::JpegBase
Abstract helper base class to access JPEG images.
Definition: jpgimage.hpp:144
Exiv2::ExifParser::decode
static ByteOrder decode(ExifData &exifData, const byte *pData, uint32_t size)
Decode metadata from a buffer pData of length size with binary Exif data to the provided metadata con...
Definition: exif.cpp:612
Exiv2::JpegBase::readMetadata
void readMetadata()
Read all metadata supported by a specific image format from the image. Before this method is called,...
Definition: jpgimage.cpp:343
Exiv2::JpegBase::sof13_
static const byte sof13_
JPEG Start-Of-Frame marker.
Definition: jpgimage.hpp:244
safe_op.hpp
Overflow checks for integers.
EXV_WARNING
#define EXV_WARNING
Shorthand for a temp warning log message object and return its ostringstream.
Definition: error.hpp:148
Exiv2::BasicIo::write
virtual long write(const byte *data, long wcount)=0
Write data to the IO source. Current IO position is advanced by the number of bytes written.
Exiv2::ExvImage
Helper class to access Exiv2 files.
Definition: jpgimage.hpp:362
Exiv2::ImageType::jpeg
const int jpeg
JPEG image type (see class JpegImage)
Definition: jpgimage.hpp:51
Exiv2::getUShort
EXIV2API uint16_t getUShort(const byte *buf, ByteOrder byteOrder)
Read a 2 byte unsigned short value from the data buffer.
Definition: types.cpp:278
Exiv2::Image::io_
BasicIo::AutoPtr io_
Image data IO pointer.
Definition: image.hpp:487
Exiv2::ByteOrder
ByteOrder
Type to express the byte order (little or big endian)
Definition: types.hpp:113
Exiv2::Image::iccProfile_
DataBuf iccProfile_
ICC buffer (binary data)
Definition: image.hpp:491
Exiv2::XmpData::usePacket
bool usePacket() const
are we to use the packet?
Definition: xmp_exiv2.hpp:252
Exiv2::Photoshop::irbId_
static const char * irbId_[]
Photoshop IRB markers
Definition: jpgimage.hpp:62
Exiv2::Image::AutoPtr
std::auto_ptr< Image > AutoPtr
Image auto_ptr type.
Definition: image.hpp:84
Exiv2::Image::xmpPacket
virtual std::string & xmpPacket()
Return a modifiable reference to the raw XMP packet.
Definition: image.cpp:566
Exiv2::Photoshop::ps3Id_
static const char ps3Id_[]
Photoshop marker
Definition: jpgimage.hpp:61
Exiv2::JpegBase::sof11_
static const byte sof11_
JPEG Start-Of-Frame marker.
Definition: jpgimage.hpp:243
Exiv2::JpegBase::sof15_
static const byte sof15_
JPEG Start-Of-Frame marker.
Definition: jpgimage.hpp:246
Safe::add
T add(T summand_1, T summand_2)
Safe addition, throws an exception on overflow.
Definition: safe_op.hpp:295
Exiv2::BasicIo::AutoPtr
std::auto_ptr< BasicIo > AutoPtr
BasicIo auto_ptr type.
Definition: basicio.hpp:58
Exiv2::Image::writeXmpFromPacket
bool writeXmpFromPacket() const
Return the flag indicating the source when writing XMP metadata.
Definition: image.cpp:728
Exiv2::Error
BasicError< char > Error
Error class used for exceptions (std::string based)
Definition: error.hpp:323
Exiv2::JpegBase::writeHeader
virtual int writeHeader(BasicIo &oIo) const =0
Writes the image header (aka signature) to the BasicIo instance.
Exiv2::isJpegType
EXIV2API bool isJpegType(BasicIo &iIo, bool advance)
Check if the file iIo is a JPEG image.
Definition: jpgimage.cpp:1361
Exiv2::IptcData
A container for IPTC data. This is a top-level class of the Exiv2 library.
Definition: iptc.hpp:173
Exiv2::JpegBase::dri_
static const byte dri_
JPEG DRI marker.
Definition: jpgimage.hpp:226
Exiv2::IptcParser::encode
static DataBuf encode(const IptcData &iptcData)
Encode the IPTC datasets from iptcData to a binary representation in IPTC IIM4 format.
Definition: iptc.cpp:509
Exiv2::string
@ string
IPTC string type.
Definition: types.hpp:147
Exiv2::PrintStructureOption
PrintStructureOption
Options for printStructure.
Definition: image.hpp:67
Exiv2::JpegBase::xmpId_
static const char xmpId_[]
XMP packet identifier.
Definition: jpgimage.hpp:249
Exiv2::Photoshop::isIrb
static bool isIrb(const byte *pPsData, long sizePsData)
Checks an IRB.
Definition: jpgimage.cpp:111
EXV_ERROR
#define EXV_ERROR
Shorthand for a temp error log message object and return its ostringstream.
Definition: error.hpp:150
Exiv2::BasicIo::seek
virtual int seek(long offset, Position pos)=0
Move the current IO position.
Exiv2::Photoshop::iptc_
static const uint16_t iptc_
Photoshop IPTC marker
Definition: jpgimage.hpp:64
Exiv2::Photoshop::setIptcIrb
static DataBuf setIptcIrb(const byte *pPsData, long sizePsData, const IptcData &iptcData)
Set the new IPTC IRB, keeps existing IRBs but removes the IPTC block if there is no new IPTC data to ...
Definition: jpgimage.cpp:239
Exiv2::JpegBase::sof10_
static const byte sof10_
JPEG Start-Of-Frame marker.
Definition: jpgimage.hpp:242
Exiv2::JpegBase::sof7_
static const byte sof7_
JPEG Start-Of-Frame marker.
Definition: jpgimage.hpp:240
Exiv2::Photoshop
Helper class, has methods to deal with Photoshop "Information Resource Blocks" (IRBs).
Definition: jpgimage.hpp:59
Exiv2::BasicIo
An interface for simple binary IO.
Definition: basicio.hpp:55
Exiv2::IptcData::count
long count() const
Get the number of metadata entries.
Definition: iptc.hpp:260
Exiv2::Image::xmpData_
XmpData xmpData_
XMP data container.
Definition: image.hpp:490
Exiv2::Image::xmpData
virtual XmpData & xmpData()
Returns an XmpData instance containing currently buffered XMP data.
Definition: image.cpp:561
Exiv2::Image
Abstract base class defining the interface for an image. This is the top-level interface to the Exiv2...
Definition: image.hpp:81
Exiv2::Image::setIccProfile
virtual void setIccProfile(DataBuf &iccProfile, bool bTestValid=true)
Set the image iccProfile. The new profile is not written to the image until the writeMetadata() metho...
Definition: image.cpp:663
Exiv2::WriteMethod
WriteMethod
Type to indicate write method used by TIFF parsers.
Definition: types.hpp:116
Exiv2::Photoshop::locatePreviewIrb
static int locatePreviewIrb(const byte *pPsData, long sizePsData, const byte **record, uint32_t *const sizeHdr, uint32_t *const sizeData)
Forwards to locatePreviewIrb() with psTag = preview_.
Definition: jpgimage.cpp:229
futils.hpp
Basic file utility functions required by Exiv2.
Exiv2::XmpParser::decode
static int decode(XmpData &xmpData, const std::string &xmpPacket)
Decode XMP metadata from an XMP packet xmpPacket into xmpData. The format of the XMP packet must foll...
Definition: xmp.cpp:723
Exiv2::JpegBase::sos_
static const byte sos_
JPEG SOS marker.
Definition: jpgimage.hpp:227
Exiv2::getULong
EXIV2API uint32_t getULong(const byte *buf, ByteOrder byteOrder)
Read a 4 byte unsigned long value from the data buffer.
Definition: types.cpp:283
Exiv2::ExvImage::isExvType
friend EXIV2API bool isExvType(BasicIo &iIo, bool advance)
Check if the file iIo is an EXV file.
Definition: jpgimage.cpp:1413
error.hpp
Error class for exceptions, log message class.
Exiv2::Photoshop::bimId_
static const char bimId_[]
Photoshop IRB marker (deprecated)
Definition: jpgimage.hpp:63
Exiv2::Blob
std::vector< byte > Blob
Container for binary data.
Definition: types.hpp:162
jpgimage.hpp
Class JpegImage to access JPEG images.