Exiv2
image.hpp
1 // ***************************************************************** -*- C++ -*-
2 /*
3  * Copyright (C) 2004-2021 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  */
20 #ifndef IMAGE_HPP_
21 #define IMAGE_HPP_
22 
23 // *****************************************************************************
24 #include "exiv2lib_export.h"
25 
26 // included header files
27 #include "basicio.hpp"
28 #include "exif.hpp"
29 #include "iptc.hpp"
30 #include "xmp_exiv2.hpp"
31 
32 // + standard includes
33 #include <string>
34 #include <vector>
35 
36 // *****************************************************************************
37 // namespace extensions
38 namespace Exiv2 {
39 
40 // *****************************************************************************
41 // class definitions
42 
44  namespace ImageType {
45  const int none = 0;
46  }
47 
49  struct NativePreview {
50  long position_;
51  uint32_t size_;
52  uint32_t width_;
53  uint32_t height_;
54  std::string filter_;
55  std::string mimeType_;
56  };
57 
59  typedef std::vector<NativePreview> NativePreviewList;
60 
64  typedef enum { kpsNone, kpsBasic, kpsXMP, kpsRecursive
65  , kpsIccProfile , kpsIptcErase
67 
78  class EXIV2API Image {
79  public:
81  typedef std::auto_ptr<Image> AutoPtr;
82 
84 
85 
90  Image(int imageType,
91  uint16_t supportedMetadata,
92  BasicIo::AutoPtr io);
94  virtual ~Image();
96 
98 
99 
106  virtual void printStructure(std::ostream& out, PrintStructureOption option =kpsNone, int depth=0);
120  virtual void readMetadata() =0;
133  virtual void writeMetadata() =0;
139  virtual void setExifData(const ExifData& exifData);
144  virtual void clearExifData();
150  virtual void setIptcData(const IptcData& iptcData);
155  virtual void clearIptcData();
167  virtual void setXmpPacket(const std::string& xmpPacket);
180  virtual void clearXmpPacket();
193  virtual void setXmpData(const XmpData& xmpData);
207  virtual void clearXmpData();
213  virtual void setComment(const std::string& comment);
218  virtual void clearComment();
225  virtual void setIccProfile(DataBuf& iccProfile,bool bTestValid=true);
230  virtual void clearIccProfile();
235  virtual bool iccProfileDefined() { return iccProfile_.size_?true:false;}
236 
240  virtual DataBuf* iccProfile() { return &iccProfile_; }
247  virtual void setMetadata(const Image& image);
252  virtual void clearMetadata();
264  virtual ExifData& exifData();
276  virtual IptcData& iptcData();
288  virtual XmpData& xmpData();
292  virtual std::string& xmpPacket();
307  void writeXmpFromPacket(bool flag);
317  void setByteOrder(ByteOrder byteOrder);
318 
324  void printTiffStructure(BasicIo& io,std::ostream& out, PrintStructureOption option,int depth,size_t offset=0);
325 
329  void printIFDStructure(BasicIo& io, std::ostream& out, Exiv2::PrintStructureOption option,uint32_t start,bool bSwap,char c,int depth);
330 
334  bool isBigEndianPlatform();
335 
339  bool isLittleEndianPlatform();
340 
341  bool isStringType(uint16_t type);
342  bool isShortType(uint16_t type);
343  bool isLongType(uint16_t type);
344  bool isLongLongType(uint16_t type);
345  bool isRationalType(uint16_t type);
346  bool is2ByteType(uint16_t type);
347  bool is4ByteType(uint16_t type);
348  bool is8ByteType(uint16_t type);
349  bool isPrintXMP(uint16_t type, Exiv2::PrintStructureOption option);
350  bool isPrintICC(uint16_t type, Exiv2::PrintStructureOption option);
351 
352  uint64_t byteSwap(uint64_t value,bool bSwap) const;
353  uint32_t byteSwap(uint32_t value,bool bSwap) const;
354  uint16_t byteSwap(uint16_t value,bool bSwap) const;
355  uint16_t byteSwap2(const DataBuf& buf,size_t offset,bool bSwap) const;
356  uint32_t byteSwap4(const DataBuf& buf,size_t offset,bool bSwap) const;
357  uint64_t byteSwap8(const DataBuf& buf,size_t offset,bool bSwap) const;
358 
360 
362 
363 
367  ByteOrder byteOrder() const;
373  bool good() const;
384  virtual std::string mimeType() const =0;
388  virtual int pixelWidth() const;
392  virtual int pixelHeight() const;
404  virtual const ExifData& exifData() const;
416  virtual const IptcData& iptcData() const;
428  virtual const XmpData& xmpData() const;
432  virtual std::string comment() const;
436  virtual const std::string& xmpPacket() const;
451  virtual BasicIo& io() const;
458  AccessMode checkMode(MetadataId metadataId) const;
463  bool supportsMetadata(MetadataId metadataId) const;
465  bool writeXmpFromPacket() const;
467  const NativePreviewList& nativePreviews() const;
469 
472  int imageType,
473  uint16_t supportedMetadata
474  ) {
475  imageType_ = imageType;
476  supportedMetadata_ = supportedMetadata;
477  }
478 
480  int imageType() const { return imageType_; }
481 
482  protected:
483  // DATA
489  std::string comment_;
490  std::string xmpPacket_;
494 
496  const std::string& tagName(uint16_t tag);
497 
499  const char* typeName(uint16_t tag) const;
500 
501  private:
503 
504  Image(const Image& rhs);
507  Image& operator=(const Image& rhs);
509 
510  // DATA
511  int imageType_;
512  uint16_t supportedMetadata_;
513  bool writeXmpFromPacket_;
514  ByteOrder byteOrder_;
515 
516  std::map<int,std::string> tags_;
517  bool init_;
518 
519  }; // class Image
520 
522  typedef Image::AutoPtr (*NewInstanceFct)(BasicIo::AutoPtr io, bool create);
524  typedef bool (*IsThisTypeFct)(BasicIo& iIo, bool advance);
525 
531  class EXIV2API ImageFactory {
532  friend bool Image::good() const;
533  public:
548  static BasicIo::AutoPtr createIo(const std::string& path, bool useCurl = true);
549 #ifdef EXV_UNICODE_PATH
550 
554  static BasicIo::AutoPtr createIo(const std::wstring& wpath, bool useCurl = true);
555 #endif
556 
569  static Image::AutoPtr open(const std::string& path, bool useCurl = true);
570 #ifdef EXV_UNICODE_PATH
571 
575  static Image::AutoPtr open(const std::wstring& wpath, bool useCurl = true);
576 #endif
577 
588  static Image::AutoPtr open(const byte* data, long size);
606  static Image::AutoPtr open(BasicIo::AutoPtr io);
616  static Image::AutoPtr create(int type, const std::string& path);
617 #ifdef EXV_UNICODE_PATH
618 
622  static Image::AutoPtr create(int type, const std::wstring& wpath);
623 #endif
624 
632  static Image::AutoPtr create(int type);
647  static Image::AutoPtr create(int type, BasicIo::AutoPtr io);
654  static int getType(const std::string& path);
655 #ifdef EXV_UNICODE_PATH
656 
660  static int getType(const std::wstring& wpath);
661 #endif
662 
669  static int getType(const byte* data, long size);
677  static int getType(BasicIo& io);
686  static AccessMode checkMode(int type, MetadataId metadataId);
707  static bool checkType(int type, BasicIo& io, bool advance);
708 
709  private:
711 
712  ImageFactory();
715  ImageFactory(const ImageFactory& rhs);
717 
718  }; // class ImageFactory
719 
720 // *****************************************************************************
721 // template, inline and free functions
722 
724  EXIV2API void append(Exiv2::Blob& blob, const byte* buf, uint32_t len);
725 
726 } // namespace Exiv2
727 
728 #endif // #ifndef IMAGE_HPP_
Exiv2::Image::iccProfile
virtual DataBuf * iccProfile()
return iccProfile
Definition: image.hpp:240
Exiv2::newMkvInstance
EXIV2LIB_DEPRECATED_EXPORT Image::AutoPtr newMkvInstance(BasicIo::AutoPtr io, bool create)
Create a new MatroskaVideo instance and return an auto-pointer to it. Caller owns the returned object...
Exiv2::ImageType::sr2
const int sr2
SR2 image type (see class TiffImage)
Definition: tiffimage.hpp:44
Exiv2::BasicIo::open
virtual int open()=0
Open the IO source using the default access mode. The default mode should allow for reading and writi...
Exiv2::ImageFactory::checkMode
static AccessMode checkMode(int type, MetadataId metadataId)
Returns the access mode or supported metadata functions for an image type and a metadata type.
Definition: image.cpp:803
Exiv2::MemIo
Provides binary IO on blocks of memory by implementing the BasicIo interface. A copy-on-write impleme...
Definition: basicio.hpp:540
Exiv2::ImageType::pgf
const int pgf
PGF image type (see class PgfImage)
Definition: pgfimage.hpp:40
Exiv2::ExifData::clear
void clear()
Delete all Exifdatum instances resulting in an empty container. Note that this also removes thumbnail...
Definition: exif.cpp:611
Exiv2::ImageType::crw
const int crw
CRW image type (see class CrwImage)
Definition: crwimage.hpp:52
Exiv2::ImageType::xmp
const int xmp
XMP sidecar files (see class XmpSidecar)
Definition: xmpsidecar.hpp:38
Exiv2::isXmpType
EXIV2API bool isXmpType(BasicIo &iIo, bool advance)
Check if the file iIo is an XMP sidecar file.
Definition: xmpsidecar.cpp:203
Exiv2::Image::xmpPacket_
std::string xmpPacket_
XMP packet.
Definition: image.hpp:490
Exiv2::NativePreview::filter_
std::string filter_
Filter.
Definition: image.hpp:54
Exiv2::isOrfType
EXIV2API bool isOrfType(BasicIo &iIo, bool advance)
Check if the file iIo is an ORF image.
Definition: orfimage.cpp:216
Exiv2::ImageType::exv
const int exv
EXV image type (see class ExvImage)
Definition: jpgimage.hpp:40
Exiv2::isQTimeType
EXIV2LIB_DEPRECATED_EXPORT bool isQTimeType(BasicIo &iIo, bool advance)
Check if the file iIo is a Quick Time Video.
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:258
nikonmn_int.hpp
Nikon makernote tags. References: [1] MakerNote EXIF Tag of the Nikon 990 by Max Lyons [2] Exif fil...
Exiv2::Image::iptcData_
IptcData iptcData_
IPTC data container.
Definition: image.hpp:486
Exiv2::newGifInstance
EXIV2API Image::AutoPtr newGifInstance(BasicIo::AutoPtr io, bool create)
Create a new GifImage instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition: gifimage.cpp:101
Exiv2::tiffFloat
@ tiffFloat
TIFF FLOAT type, single precision (4-byte) IEEE format.
Definition: types.hpp:130
Exiv2::Image::clearIptcData
virtual void clearIptcData()
Erase any buffered IPTC data. IPTC data is not removed from the actual image until the writeMetadata(...
Definition: image.cpp:636
Exiv2::Internal::indent
std::string indent(int32_t d)
indent output for kpsRecursive in printStructure() .
Definition: image_int.cpp:106
Exiv2::FileIo
Provides binary file IO by implementing the BasicIo interface.
Definition: basicio.hpp:296
Exiv2::Image::pixelWidth
virtual int pixelWidth() const
Return the pixel width of the image.
Definition: image.cpp:717
Exiv2::Image::Image
Image(int imageType, uint16_t supportedMetadata, BasicIo::AutoPtr io)
Constructor taking the image type, a bitmap of the supported metadata types and an auto-pointer that ...
Definition: image.cpp:167
Exiv2::IoCloser
Utility class that closes a BasicIo instance upon destruction. Meant to be used as a stack variable i...
Definition: basicio.hpp:264
exif.hpp
Encoding and decoding of Exif data.
crwimage.hpp
Class CrwImage to access Canon CRW images. References: The Canon RAW (CRW) File Format by Phil Harv...
Exiv2::BasicIo::Position
Position
Seek starting positions.
Definition: basicio.hpp:61
Exiv2::ImageFactory
Returns an Image instance of the specified type.
Definition: image.hpp:531
Exiv2::newEpsInstance
EXIV2LIB_DEPRECATED_EXPORT Image::AutoPtr newEpsInstance(BasicIo::AutoPtr io, bool create)
Create a new EpsImage instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition: epsimage.cpp:1154
Exiv2::ImageType::tiff
const int tiff
TIFF image type (see class TiffImage)
Definition: tiffimage.hpp:39
bmpimage.hpp
Windows Bitmap (BMP) image.
Exiv2::isCr2Type
EXIV2API bool isCr2Type(BasicIo &iIo, bool advance)
Check if the file iIo is a CR2 image.
Definition: cr2image.cpp:212
Exiv2::Image::nativePreviews_
NativePreviewList nativePreviews_
list of native previews
Definition: image.hpp:493
Exiv2::ImageFactory::checkType
static bool checkType(int type, BasicIo &io, bool advance)
Determine if the content of io is an image of type.
Definition: image.cpp:830
Exiv2::NativePreview::width_
uint32_t width_
Width.
Definition: image.hpp:52
Exiv2::Image::typeName
const char * typeName(uint16_t tag) const
Return tag type for given tag id.
Definition: image.cpp:323
Exiv2::Image::isBigEndianPlatform
bool isBigEndianPlatform()
is the host platform bigEndian
Definition: image.cpp:251
Exiv2::undefined
@ undefined
Exif UNDEFINED type, an 8-bit byte that may contain anything.
Definition: types.hpp:126
Exiv2::isGifType
EXIV2API bool isGifType(BasicIo &iIo, bool advance)
Check if the file iIo is a GIF image.
Definition: gifimage.cpp:111
Exiv2::getType
TypeId getType()
Template to determine the TypeId for a type T.
Exiv2::XmpParser::omitAllFormatting
@ omitAllFormatting
Omit all formatting whitespace.
Definition: xmp_exiv2.hpp:278
Exiv2::ImageType::nef
const int nef
NEF image type (see class TiffImage)
Definition: tiffimage.hpp:41
Exiv2::ImageType::cr2
const int cr2
CR2 image type (see class Cr2Image)
Definition: cr2image.hpp:45
Exiv2::Image::comment_
std::string comment_
User comment.
Definition: image.hpp:489
Exiv2::isAsfType
EXIV2LIB_DEPRECATED_EXPORT bool isAsfType(BasicIo &iIo, bool advance)
Check if the file iIo is a Windows Asf Video.
Exiv2::ImageType::bmp
const int bmp
Windows bitmap (bmp) image type (see class BmpImage)
Definition: bmpimage.hpp:45
Exiv2::signedLongLong
@ signedLongLong
Exif LONG LONG type, 64-bit (8-byte) signed integer.
Definition: types.hpp:134
Exiv2::signedShort
@ signedShort
Exif SSHORT type, a 16-bit (2-byte) signed (twos-complement) integer.
Definition: types.hpp:127
Exiv2::isExvType
EXIV2API bool isExvType(BasicIo &iIo, bool advance)
Check if the file iIo is an EXV file.
Definition: jpgimage.cpp:1406
Exiv2::makeSlice
Slice< T > makeSlice(T &cont, size_t begin, size_t end)
Return a new slice with the given bounds.
Definition: slice.hpp:665
Exiv2::comment
@ comment
Exiv2 type for the Exif user comment.
Definition: types.hpp:139
Exiv2::XmpData::clear
void clear()
Delete all Xmpdatum instances resulting in an empty container.
Definition: xmp.cpp:508
Exiv2::asciiString
@ asciiString
Exif ASCII type, 8-bit byte.
Definition: types.hpp:121
Exiv2::NativePreview
Native preview information. This is meant to be used only by the PreviewManager.
Definition: image.hpp:49
Exiv2::Image::comment
virtual std::string comment() const
Return a copy of the image comment. May be an empty string.
Definition: image.cpp:742
Exiv2::Image::nativePreviews
const NativePreviewList & nativePreviews() const
Return list of native previews. This is meant to be used only by the PreviewManager.
Definition: image.cpp:762
Exiv2::strError
EXIV2API std::string strError()
Return a system error message and the error code (errno). See strerror(3).
Definition: futils.cpp:316
Exiv2::ImageType::mrw
const int mrw
MRW image type (see class MrwImage)
Definition: mrwimage.hpp:38
Exiv2::Image::pixelHeight
virtual int pixelHeight() const
Return the pixel height of the image.
Definition: image.cpp:722
Exiv2::Image::setComment
virtual void setComment(const std::string &comment)
Set the image comment. The new comment is not written to the image until the writeMetadata() method i...
Definition: image.cpp:687
Exiv2::ImageType::gif
const int gif
GIF image type (see class GifImage)
Definition: gifimage.hpp:38
Exiv2::isMrwType
EXIV2API bool isMrwType(BasicIo &iIo, bool advance)
Check if the file iIo is a MRW image.
Definition: mrwimage.cpp:165
Exiv2::Internal::iopTagList
const TagInfo * iopTagList()
Return read-only list of built-in IOP tags.
Definition: tags_int.cpp:2419
Exiv2::ImageType::raf
const int raf
RAF image type (see class RafImage)
Definition: rafimage.hpp:43
Exiv2::HttpIo
Provides the http read/write access for the RemoteIo.
Definition: basicio.hpp:1015
Exiv2::isRw2Type
EXIV2API bool isRw2Type(BasicIo &iIo, bool advance)
Check if the file iIo is a RW2 image.
Definition: rw2image.cpp:250
Exiv2::Image::exifData_
ExifData exifData_
Exif data container.
Definition: image.hpp:485
Exiv2::newTiffInstance
EXIV2API Image::AutoPtr newTiffInstance(BasicIo::AutoPtr io, bool create)
Create a new TiffImage instance and return an auto-pointer to it. Caller owns the returned object and...
Definition: tiffimage.cpp:317
Exiv2::Image::printIFDStructure
void printIFDStructure(BasicIo &io, std::ostream &out, Exiv2::PrintStructureOption option, uint32_t start, bool bSwap, char c, int depth)
Print out the structure of a TIFF IFD.
Definition: image.cpp:352
Exiv2::isPgfType
EXIV2API bool isPgfType(BasicIo &iIo, bool advance)
Check if the file iIo is a PGF image.
Definition: pgfimage.cpp:327
Exiv2::isTiffType
EXIV2API bool isTiffType(BasicIo &iIo, bool advance)
Check if the file iIo is a TIFF image.
Definition: tiffimage.cpp:326
Exiv2::unsignedLong
@ unsignedLong
Exif LONG type, 32-bit (4-byte) unsigned integer.
Definition: types.hpp:123
asfvideo.hpp
An Image subclass to support ASF video files.
Exiv2::tiffIfd8
@ tiffIfd8
TIFF IFD type, 64-bit (8-byte) unsigned integer.
Definition: types.hpp:135
Exiv2::Image::setIptcData
virtual void setIptcData(const IptcData &iptcData)
Assign new IPTC data. The new IPTC data is not written to the image until the writeMetadata() method ...
Definition: image.cpp:641
Exiv2::isTgaType
EXIV2API bool isTgaType(BasicIo &iIo, bool advance)
Check if the file iIo is a Targa v2 image.
Definition: tgaimage.cpp:133
Exiv2::Image::setTypeSupported
void setTypeSupported(int imageType, uint16_t supportedMetadata)
set type support for this image format
Definition: image.hpp:471
Exiv2::Internal::binaryToString
binaryToStringHelper< T > binaryToString(const Slice< T > sl)
format binary data for display in Image::printStructure()
Definition: image_int.hpp:118
Exiv2::tiffDouble
@ tiffDouble
TIFF DOUBLE type, double precision (8-byte) IEEE format.
Definition: types.hpp:131
Exiv2::IptcData::clear
void clear()
Delete all Iptcdatum instances resulting in an empty container.
Definition: iptc.hpp:215
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:235
cr2image.hpp
Class Cr2Image.
Exiv2::Image::pixelHeight_
int pixelHeight_
image pixel height
Definition: image.hpp:492
Exiv2::isPsdType
EXIV2API bool isPsdType(BasicIo &iIo, bool advance)
Check if the file iIo is a Photoshop image.
Definition: psdimage.cpp:696
Exiv2::ImageType::psd
const int psd
Photoshop (PSD) image type (see class PsdImage)
Definition: psdimage.hpp:38
Exiv2::pathOfFileUrl
EXIV2API std::string pathOfFileUrl(const std::string &url)
Get the path of file URL.
Definition: futils.cpp:301
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:1345
Exiv2::isWebPType
EXIV2API bool isWebPType(BasicIo &iIo, bool advance)
Check if the file iIo is a WebP Video.
Definition: webpimage.cpp:743
Exiv2::newRiffInstance
EXIV2LIB_DEPRECATED_EXPORT Image::AutoPtr newRiffInstance(BasicIo::AutoPtr io, bool create)
Create a new RiffVideo instance and return an auto-pointer to it. Caller owns the returned object and...
Exiv2::Image::clearMetadata
virtual void clearMetadata()
Erase all buffered metadata. Metadata is not removed from the actual image until the writeMetadata() ...
Definition: image.cpp:570
Exiv2::newCr2Instance
EXIV2API Image::AutoPtr newCr2Instance(BasicIo::AutoPtr io, bool create)
Create a new Cr2Image instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition: cr2image.cpp:203
Exiv2::Image::clearXmpData
virtual void clearXmpData()
Erase any buffered XMP data. XMP data is not removed from the actual image until the writeMetadata() ...
Definition: image.cpp:661
Exiv2::Internal::Nikon1MakerNote::tagList
static const TagInfo * tagList()
Return read-only list of built-in Nikon1 tags.
Definition: nikonmn_int.cpp:266
Exiv2::newQTimeInstance
EXIV2LIB_DEPRECATED_EXPORT Image::AutoPtr newQTimeInstance(BasicIo::AutoPtr io, bool create)
Create a new QuicktimeVideo instance and return an auto-pointer to it. Caller owns the returned objec...
Exiv2::ImageType::asf
const int asf
Treating asf as an image type>
Definition: asfvideo.hpp:43
Exiv2::tiffIfd
@ tiffIfd
TIFF IFD type, 32-bit (4-byte) unsigned integer.
Definition: types.hpp:132
Exiv2::NativePreview::position_
long position_
Position.
Definition: image.hpp:50
Exiv2::Image::setMetadata
virtual void setMetadata(const Image &image)
Copy all existing metadata from source Image. The data is copied into internal buffers and is not wri...
Definition: image.cpp:606
Exiv2::ImageFactory::open
static Image::AutoPtr open(const std::string &path, bool useCurl=true)
Create an Image subclass of the appropriate type by reading the specified file. Image type is derived...
Definition: image.cpp:922
Exiv2::NativePreview::size_
uint32_t size_
Size.
Definition: image.hpp:51
Exiv2::ImageType::jp2
const int jp2
JPEG-2000 image type.
Definition: jp2image.hpp:45
Exiv2::MetadataId
MetadataId
An identifier for each type of metadata.
Definition: types.hpp:108
Exiv2::DataBuf::free
void free()
Free the internal buffer and reset the size to 0.
Definition: types.cpp:175
Exiv2::Image::clearComment
virtual void clearComment()
Erase any buffered comment. Comment is not removed from the actual image until the writeMetadata() me...
Definition: image.cpp:682
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:1398
Exiv2::Image::isLittleEndianPlatform
bool isLittleEndianPlatform()
is the host platform littleEndian
Definition: image.cpp:260
Exiv2::Internal::stringFormat
std::string stringFormat(const char *format,...)
format a string in the pattern of sprintf .
Definition: image_int.cpp:32
Exiv2::unsignedRational
@ unsignedRational
Exif RATIONAL type, two LONGs: numerator and denumerator of a fraction.
Definition: types.hpp:124
Exiv2::Image::supportsMetadata
bool supportsMetadata(MetadataId metadataId) const
Check if image supports a particular type of metadata. This method is deprecated. Use checkMode() ins...
Definition: image.cpp:774
Exiv2::Image::setByteOrder
void setByteOrder(ByteOrder byteOrder)
Set the byte order to encode the Exif metadata in.
Definition: image.cpp:707
Exiv2::ImageFactory::getType
static int getType(const std::string &path)
Returns the image type of the provided file.
Definition: image.cpp:839
Exiv2::Image::byteOrder
ByteOrder byteOrder() const
Return the byte order in which the Exif metadata of the image is encoded. Initially,...
Definition: image.cpp:712
Exiv2::newRafInstance
EXIV2API Image::AutoPtr newRafInstance(BasicIo::AutoPtr io, bool create)
Create a new RafImage instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition: rafimage.cpp:399
Exiv2::newXmpInstance
EXIV2API Image::AutoPtr newXmpInstance(BasicIo::AutoPtr io, bool create)
Create a new XmpSidecar instance and return an auto-pointer to it. Caller owns the returned object an...
Definition: xmpsidecar.cpp:194
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:347
Exiv2::newOrfInstance
EXIV2API Image::AutoPtr newOrfInstance(BasicIo::AutoPtr io, bool create)
Create a new OrfImage instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition: orfimage.cpp:207
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:1013
Exiv2::NewInstanceFct
Image::AutoPtr(* NewInstanceFct)(BasicIo::AutoPtr io, bool create)
Type for function pointer that creates new Image instances.
Definition: image.hpp:522
Exiv2::Image::pixelWidth_
int pixelWidth_
image pixel width
Definition: image.hpp:491
Exiv2::Image::good
bool good() const
Check if the Image instance is valid. Use after object construction.
Definition: image.cpp:767
Exiv2::isMkvType
EXIV2LIB_DEPRECATED_EXPORT bool isMkvType(BasicIo &iIo, bool advance)
Check if the file iIo is a Matroska Video.
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:552
Exiv2::ImageFactory::createIo
static BasicIo::AutoPtr createIo(const std::string &path, bool useCurl=true)
Create the appropriate class type implemented BasicIo based on the protocol of the input.
Definition: image.cpp:871
Exiv2::isEpsType
EXIV2LIB_DEPRECATED_EXPORT bool isEpsType(BasicIo &iIo, bool advance)
Check if the file iIo is a EPS image.
Definition: epsimage.cpp:1163
Exiv2::fileProtocol
EXIV2API Protocol fileProtocol(const std::string &path)
Return the protocol of the path.
Definition: futils.cpp:221
Exiv2::DataBuf
Utility class containing a character array. All it does is to take care of memory allocation and dele...
Definition: types.hpp:193
Exiv2::unsignedByte
@ unsignedByte
Exif BYTE type, 8-bit unsigned integer.
Definition: types.hpp:120
Exiv2::ImageType::qtime
const int qtime
Treating qtime as an image type>
Definition: quicktimevideo.hpp:39
Exiv2::XmpParser::useCompactFormat
@ useCompactFormat
Use a compact form of RDF.
Definition: xmp_exiv2.hpp:274
Exiv2::isRafType
EXIV2API bool isRafType(BasicIo &iIo, bool advance)
Check if the file iIo is a RAF image.
Definition: rafimage.cpp:408
Exiv2::signedByte
@ signedByte
Exif SBYTE type, an 8-bit signed (twos-complement) integer.
Definition: types.hpp:125
Exiv2::XmpData::count
long count() const
Get the number of metadata entries.
Definition: xmp.cpp:533
Exiv2::DataBuf::size_
long size_
The current size of the buffer.
Definition: types.hpp:260
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:1000
Exiv2::isBmpType
EXIV2API bool isBmpType(BasicIo &iIo, bool advance)
Check if the file iIo is a Windows Bitmap image.
Definition: bmpimage.cpp:132
Exiv2::find
const T * find(T(&src)[N], const K &key)
Find an element that matches key in the array src.
Definition: types.hpp:497
Exiv2::newAsfInstance
EXIV2LIB_DEPRECATED_EXPORT Image::AutoPtr newAsfInstance(BasicIo::AutoPtr io, bool create)
Create a new AsfVideo instance and return an auto-pointer to it. Caller owns the returned object and ...
Exiv2::ImageType::mkv
const int mkv
Treating mkv as an image type>
Definition: matroskavideo.hpp:38
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::isRiffType
EXIV2LIB_DEPRECATED_EXPORT bool isRiffType(BasicIo &iIo, bool advance)
Check if the file iIo is a Riff Video.
Exiv2::Protocol
Protocol
the collection of protocols.
Definition: futils.hpp:38
Exiv2::unsignedShort
@ unsignedShort
Exif SHORT type, 16-bit (2-byte) unsigned integer.
Definition: types.hpp:122
Exiv2::Image::imageType
int imageType() const
set type support for this image format
Definition: image.hpp:480
Exiv2
Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of ...
Definition: asfvideo.hpp:36
Exiv2::Internal::mpfTagList
const TagInfo * mpfTagList()
Return read-only list of built-in mfp Tags http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/MPF....
Definition: tags_int.cpp:2386
Exiv2::XmpData
A container for XMP data. This is a top-level class of the Exiv2 library.
Definition: xmp_exiv2.hpp:166
Exiv2::Image::clearIccProfile
virtual void clearIccProfile()
Erase iccProfile. the profile is not removed from the actual image until the writeMetadata() method i...
Definition: image.cpp:702
Exiv2::signedLong
@ signedLong
Exif SLONG type, a 32-bit (4-byte) signed (twos-complement) integer.
Definition: types.hpp:128
Exiv2::newWebPInstance
EXIV2API Image::AutoPtr newWebPInstance(BasicIo::AutoPtr io, bool create)
Create a new WebPImage instance and return an auto-pointer to it. Caller owns the returned object and...
Definition: webpimage.cpp:734
Exiv2::Image::io
virtual BasicIo & io() const
Return a reference to the BasicIo instance being used for Io.
Definition: image.cpp:752
Exiv2::ImageType::pef
const int pef
PEF image type (see class TiffImage)
Definition: tiffimage.hpp:42
Exiv2::ImageType::none
const int none
Not an image.
Definition: image.hpp:45
Exiv2::ImageType::webp
const int webp
Treating webp as an image type>
Definition: webpimage.hpp:38
Exiv2::Image::clearXmpPacket
virtual void clearXmpPacket()
Erase the buffered XMP packet. XMP data is not removed from the actual image until the writeMetadata(...
Definition: image.cpp:646
Exiv2::BasicIo::path
virtual std::string path() const =0
Return the path to the IO resource. Often used to form comprehensive error messages where only a Basi...
Exiv2::newPngInstance
EXIV2API Image::AutoPtr newPngInstance(BasicIo::AutoPtr io, bool create)
Create a new PngImage instance and return an auto-pointer to it. Caller owns the returned object and ...
Exiv2::signedRational
@ signedRational
Exif SRATIONAL type, two SLONGs: numerator and denumerator of a fraction.
Definition: types.hpp:129
Exiv2::newPgfInstance
EXIV2API Image::AutoPtr newPgfInstance(BasicIo::AutoPtr io, bool create)
Create a new PgfImage instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition: pgfimage.cpp:317
Exiv2::NativePreview::height_
uint32_t height_
Height.
Definition: image.hpp:53
Exiv2::TagInfo
Tag information.
Definition: tags.hpp:74
Exiv2::Internal::exifTagList
const TagInfo * exifTagList()
Return read-only list of built-in Exif IFD tags.
Definition: tags_int.cpp:2096
Exiv2::ImageType::orf
const int orf
ORF image type (see class OrfImage)
Definition: orfimage.hpp:38
Exiv2::Internal::operator==
bool operator==(const TagDetails &td, const LensTypeAndFocalLengthAndMaxAperture &ltfl)
Compare tag details with a lens entry.
Definition: canonmn_int.cpp:2820
Exiv2::ImageType::jpeg
const int jpeg
JPEG image type (see class JpegImage)
Definition: jpgimage.hpp:39
Exiv2::Image::setExifData
virtual void setExifData(const ExifData &exifData)
Assign new Exif data. The new Exif data is not written to the image until the writeMetadata() method ...
Definition: image.cpp:631
Exiv2::Internal::gpsTagList
const TagInfo * gpsTagList()
Return read-only list of built-in GPS tags.
Definition: tags_int.cpp:2316
Exiv2::Image::io_
BasicIo::AutoPtr io_
Image data IO pointer.
Definition: image.hpp:484
Exiv2::BasicIo::size
virtual size_t size() const =0
Get the current size of the IO source in bytes.
Exiv2::ByteOrder
ByteOrder
Type to express the byte order (little or big endian)
Definition: types.hpp:102
Exiv2::Image::iccProfile_
DataBuf iccProfile_
ICC buffer (binary data)
Definition: image.hpp:488
Exiv2::newRw2Instance
EXIV2API Image::AutoPtr newRw2Instance(BasicIo::AutoPtr io, bool create)
Create a new Rw2Image instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition: rw2image.cpp:241
Exiv2::AccessMode
AccessMode
An identifier for each mode of metadata support.
Definition: types.hpp:111
Exiv2::makeSliceUntil
Slice< container > makeSliceUntil(container &cont, size_t end)
Return a new slice spanning until end.
Definition: slice.hpp:702
Exiv2::ImageType::dng
const int dng
DNG image type (see class TiffImage)
Definition: tiffimage.hpp:40
Exiv2::Internal::ifdTagList
const TagInfo * ifdTagList()
Return read-only list of built-in IFD0/1 tags.
Definition: tags_int.cpp:1709
Exiv2::Image::AutoPtr
std::auto_ptr< Image > AutoPtr
Image auto_ptr type.
Definition: image.hpp:81
Exiv2::Image::xmpPacket
virtual std::string & xmpPacket()
Return a modifiable reference to the raw XMP packet.
Definition: image.cpp:595
Exiv2::newBmpInstance
EXIV2API Image::AutoPtr newBmpInstance(BasicIo::AutoPtr io, bool create)
Create a new BmpImage instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition: bmpimage.cpp:123
Exiv2::Image::checkMode
AccessMode checkMode(MetadataId metadataId) const
Returns the access mode, i.e., the metadata functions, which this image supports for the metadata typ...
Definition: image.cpp:779
Exiv2::isCrwType
EXIV2API bool isCrwType(BasicIo &iIo, bool advance)
Check if the file iIo is a CRW image.
Definition: crwimage.cpp:195
Exiv2::ImageType::riff
const int riff
Treating riff as an image type>
Definition: riffvideo.hpp:39
Safe::add
T add(T summand_1, T summand_2)
Safe addition, throws an exception on overflow.
Definition: safe_op.hpp:288
Exiv2::BasicIo::AutoPtr
std::auto_ptr< BasicIo > AutoPtr
BasicIo auto_ptr type.
Definition: basicio.hpp:58
epsimage.hpp
EPS image. References: [1] Adobe PostScript Language Document Structuring Conventions Specification...
Exiv2::Image::writeXmpFromPacket
bool writeXmpFromPacket() const
Return the flag indicating the source when writing XMP metadata.
Definition: image.cpp:757
Exiv2::XPathIo
Provides binary IO for the data from stdin and data uri path.
Definition: basicio.hpp:761
Exiv2::Error
BasicError< char > Error
Error class used for exceptions (std::string based)
Definition: error.hpp:324
Exiv2::isJpegType
EXIV2API bool isJpegType(BasicIo &iIo, bool advance)
Check if the file iIo is a JPEG image.
Definition: jpgimage.cpp:1354
Exiv2::IptcData
A container for IPTC data. This is a top-level class of the Exiv2 library.
Definition: iptc.hpp:170
Exiv2::Image::setXmpPacket
virtual void setXmpPacket(const std::string &xmpPacket)
Assign a raw XMP packet. The new XMP packet is not written to the image until the writeMetadata() met...
Definition: image.cpp:652
Exiv2::NativePreviewList
std::vector< NativePreview > NativePreviewList
List of native previews. This is meant to be used only by the PreviewManager.
Definition: image.hpp:59
Exiv2::unsignedLongLong
@ unsignedLongLong
Exif LONG LONG type, 64-bit (8-byte) unsigned integer.
Definition: types.hpp:133
Exiv2::ImageType::tga
const int tga
Truevision TARGA (tga) image type (see class TgaImage)
Definition: tgaimage.hpp:38
Exiv2::ImageType::arw
const int arw
ARW image type (see class TiffImage)
Definition: tiffimage.hpp:43
Exiv2::Image::clearExifData
virtual void clearExifData()
Erase any buffered Exif data. Exif data is not removed from the actual image until the writeMetadata(...
Definition: image.cpp:626
Exiv2::ImageType::rw2
const int rw2
RW2 image type (see class Rw2Image)
Definition: rw2image.hpp:38
Exiv2::Image::tagName
const std::string & tagName(uint16_t tag)
Return tag name for given tag id.
Definition: image.cpp:784
Exiv2::TagInfo::tag_
uint16_t tag_
Tag.
Definition: tags.hpp:87
Exiv2::newJp2Instance
EXIV2API Image::AutoPtr newJp2Instance(BasicIo::AutoPtr io, bool create)
Create a new Jp2Image instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition: jp2image.cpp:975
Exiv2::newPsdInstance
EXIV2API Image::AutoPtr newPsdInstance(BasicIo::AutoPtr io, bool create)
Create a new PsdImage instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition: psdimage.cpp:686
Exiv2::PrintStructureOption
PrintStructureOption
Options for printStructure.
Definition: image.hpp:64
EXV_ERROR
#define EXV_ERROR
Shorthand for a temp error log message object and return its ostringstream.
Definition: error.hpp:150
Exiv2::BasicIo::tell
virtual long tell() const =0
Get the current IO position.
Exiv2::BasicIo::seek
virtual int seek(long offset, Position pos)=0
Move the current IO position.
Exiv2::ErrorCode
ErrorCode
Complete list of all Exiv2 error codes.
Definition: error.hpp:191
Exiv2::ImageType::png
const int png
PNG image type (see class PngImage)
Definition: pngimage.hpp:40
Exiv2::isJp2Type
EXIV2API bool isJp2Type(BasicIo &iIo, bool advance)
Check if the file iIo is a JPEG-2000 image.
Definition: jp2image.cpp:985
Exiv2::BasicIo
An interface for simple binary IO.
Definition: basicio.hpp:55
Exiv2::ImageFactory::create
static Image::AutoPtr create(int type, const std::string &path)
Create an Image subclass of the requested type by creating a new image file. If the file already exis...
Definition: image.cpp:959
Exiv2::FileIo::close
virtual int close()
Flush and unwritten data and close the file . It is safe to call close on an already closed instance.
Definition: basicio.cpp:981
Exiv2::Image::xmpData_
XmpData xmpData_
XMP data container.
Definition: image.hpp:487
Exiv2::FileIo::open
int open(const std::string &mode)
Open the file using using the specified mode.
Definition: basicio.cpp:958
Exiv2::Image::xmpData
virtual XmpData & xmpData()
Returns an XmpData instance containing currently buffered XMP data.
Definition: image.cpp:590
Exiv2::Image
Abstract base class defining the interface for an image. This is the top-level interface to the Exiv2...
Definition: image.hpp:78
Exiv2::newTgaInstance
EXIV2API Image::AutoPtr newTgaInstance(BasicIo::AutoPtr io, bool create)
Create a new TgaImage instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition: tgaimage.cpp:123
Exiv2::newMrwInstance
EXIV2API Image::AutoPtr newMrwInstance(BasicIo::AutoPtr io, bool create)
Create a new MrwImage instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition: mrwimage.cpp:156
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:692
Exiv2::NativePreview::mimeType_
std::string mimeType_
MIME type.
Definition: image.hpp:55
Exiv2::IsThisTypeFct
bool(* IsThisTypeFct)(BasicIo &iIo, bool advance)
Type for function pointer that checks image types.
Definition: image.hpp:524
Exiv2::ImageType::srw
const int srw
SRW image type (see class TiffImage)
Definition: tiffimage.hpp:45
Exiv2::newCrwInstance
EXIV2API Image::AutoPtr newCrwInstance(BasicIo::AutoPtr io, bool create)
Create a new CrwImage instance and return an auto-pointer to it. Caller owns the returned object and ...
Definition: crwimage.cpp:186
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:887
Exiv2::Image::iptcData
virtual IptcData & iptcData()
Returns an IptcData instance containing currently buffered IPTC data.
Definition: image.cpp:585
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:278
Exiv2::Image::~Image
virtual ~Image()
Virtual Destructor.
Definition: image.cpp:186
error.hpp
Error class for exceptions, log message class.
Exiv2::Image::setXmpData
virtual void setXmpData(const XmpData &xmpData)
Assign new XMP data. The new XMP data is not written to the image until the writeMetadata() method is...
Definition: image.cpp:667
Exiv2::Image::exifData
virtual ExifData & exifData()
Returns an ExifData instance containing currently buffered Exif data.
Definition: image.cpp:580
Exiv2::Blob
std::vector< byte > Blob
Container for binary data.
Definition: types.hpp:151
iptc.hpp
Encoding and decoding of IPTC data.
Exiv2::ImageType::eps
const int eps
EPS image type.
Definition: epsimage.hpp:53
Exiv2::Image::printStructure
virtual void printStructure(std::ostream &out, PrintStructureOption option=kpsNone, int depth=0)
Print out the structure of image file.
Definition: image.cpp:190
Exiv2::ExifData
A container for Exif data. This is a top-level class of the Exiv2 library. The container holds Exifda...
Definition: exif.hpp:434
Exiv2::isPngType
EXIV2API bool isPngType(BasicIo &iIo, bool advance)
Check if the file iIo is a PNG image.