 |
Exiv2
|
Go to the documentation of this file.
34 #include "exiv2lib_export.h"
110 void readResourceBlock(uint16_t resourceId, uint32_t resourceSize);
118 void doWriteMetadata(
BasicIo& oIo);
125 uint32_t writeXmpData(
const XmpData& xmpData,
BasicIo& out)
const;
147 #endif // #ifndef PSDIMAGE_HPP_
Provides binary IO on blocks of memory by implementing the BasicIo interface. A copy-on-write impleme...
Definition: basicio.hpp:540
void clear()
Delete all Exifdatum instances resulting in an empty container. Note that this also removes thumbnail...
Definition: exif.cpp:587
std::string xmpPacket_
XMP packet.
Definition: image.hpp:493
virtual bool isopen() const =0
Returns true if the IO source is open, otherwise false.
virtual int error() const =0
Returns 0 if the IO source is in a valid state, otherwise nonzero.
IptcData iptcData_
IPTC data container.
Definition: image.hpp:489
Photoshop image, implemented using the following references: Adobe Photoshop 6.0 File Format Specific...
Utility class that closes a BasicIo instance upon destruction. Meant to be used as a stack variable i...
Definition: basicio.hpp:264
NativePreviewList nativePreviews_
list of native previews
Definition: image.hpp:496
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
@ comment
Exiv2 type for the Exif user comment.
Definition: types.hpp:150
EXIV2API std::string strError()
Return a system error message and the error code (errno). See strerror(3).
Definition: futils.cpp:352
void writeMetadata()
Write metadata back to the image.
Definition: psdimage.cpp:352
ExifData exifData_
Exif data container.
Definition: image.hpp:488
void clear()
Delete all Iptcdatum instances resulting in an empty container.
Definition: iptc.hpp:218
int pixelHeight_
image pixel height
Definition: image.hpp:495
EXIV2API bool isPsdType(BasicIo &iIo, bool advance)
Check if the file iIo is a Photoshop image.
Definition: psdimage.cpp:702
const int psd
Photoshop (PSD) image type (see class PsdImage)
Definition: psdimage.hpp:48
virtual void clearMetadata()
Erase all buffered metadata. Metadata is not removed from the actual image until the writeMetadata() ...
Definition: image.cpp:541
Port of D's enforce() to C++ & Exiv2.
Class to access raw Photoshop images.
Definition: psdimage.hpp:54
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
void setByteOrder(ByteOrder byteOrder)
Set the byte order to encode the Exif metadata in.
Definition: image.cpp:678
ByteOrder byteOrder() const
Return the byte order in which the Exif metadata of the image is encoded. Initially,...
Definition: image.cpp:683
int pixelWidth_
image pixel width
Definition: image.hpp:494
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
std::string mimeType() const
Return the MIME type of the image.
Definition: psdimage.cpp:131
void readMetadata()
Read all metadata supported by a specific image format from the image. Before this method is called,...
Definition: psdimage.cpp:142
Utility class containing a character array. All it does is to take care of memory allocation and dele...
Definition: types.hpp:204
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
EXIV2API int32_t getLong(const byte *buf, ByteOrder byteOrder)
Read a 4 byte signed long value from the data buffer.
Definition: types.cpp:328
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
virtual bool eof() const =0
Returns true if the IO position has reached the end, otherwise false.
virtual DataBuf read(long rcount)=0
Read data from the IO source. Reading starts at the current IO position and the position is advanced ...
void setComment(const std::string &comment)
Not supported. Calling this function will throw an Error(kerInvalidSettingForImage).
Definition: psdimage.cpp:136
long count() const
Get the number of metadata entries.
Definition: exif.hpp:514
Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of ...
Definition: asfvideo.hpp:36
A container for XMP data. This is a top-level class of the Exiv2 library.
Definition: xmp_exiv2.hpp:173
virtual std::string path() const =0
Return the path to the IO resource. Often used to form comprehensive error messages where only a Basi...
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
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
Overflow checks for integers.
#define EXV_WARNING
Shorthand for a temp warning log message object and return its ostringstream.
Definition: error.hpp:148
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.
EXIV2API uint16_t getUShort(const byte *buf, ByteOrder byteOrder)
Read a 2 byte unsigned short value from the data buffer.
Definition: types.cpp:278
BasicIo::AutoPtr io_
Image data IO pointer.
Definition: image.hpp:487
ByteOrder
Type to express the byte order (little or big endian)
Definition: types.hpp:113
static const char * irbId_[]
Photoshop IRB markers
Definition: jpgimage.hpp:62
std::auto_ptr< Image > AutoPtr
Image auto_ptr type.
Definition: image.hpp:84
virtual std::string & xmpPacket()
Return a modifiable reference to the raw XMP packet.
Definition: image.cpp:566
std::auto_ptr< BasicIo > AutoPtr
BasicIo auto_ptr type.
Definition: basicio.hpp:58
bool writeXmpFromPacket() const
Return the flag indicating the source when writing XMP metadata.
Definition: image.cpp:728
BasicError< char > Error
Error class used for exceptions (std::string based)
Definition: error.hpp:323
A container for IPTC data. This is a top-level class of the Exiv2 library.
Definition: iptc.hpp:173
static DataBuf encode(const IptcData &iptcData)
Encode the IPTC datasets from iptcData to a binary representation in IPTC IIM4 format.
Definition: iptc.cpp:509
@ string
IPTC string type.
Definition: types.hpp:147
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:692
static bool isIrb(const byte *pPsData, long sizePsData)
Checks an IRB.
Definition: jpgimage.cpp:111
#define EXV_ERROR
Shorthand for a temp error log message object and return its ostringstream.
Definition: error.hpp:150
virtual int seek(long offset, Position pos)=0
Move the current IO position.
An interface for simple binary IO.
Definition: basicio.hpp:55
long count() const
Get the number of metadata entries.
Definition: iptc.hpp:260
XmpData xmpData_
XMP data container.
Definition: image.hpp:490
virtual XmpData & xmpData()
Returns an XmpData instance containing currently buffered XMP data.
Definition: image.cpp:561
Abstract base class defining the interface for an image. This is the top-level interface to the Exiv2...
Definition: image.hpp:81
Basic file utility functions required by Exiv2.
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
virtual IptcData & iptcData()
Returns an IptcData instance containing currently buffered IPTC data.
Definition: image.cpp:556
EXIV2API uint32_t getULong(const byte *buf, ByteOrder byteOrder)
Read a 4 byte unsigned long value from the data buffer.
Definition: types.cpp:283
Error class for exceptions, log message class.
virtual ExifData & exifData()
Returns an ExifData instance containing currently buffered Exif data.
Definition: image.cpp:551
std::vector< byte > Blob
Container for binary data.
Definition: types.hpp:162
Class JpegImage to access JPEG images.
A container for Exif data. This is a top-level class of the Exiv2 library. The container holds Exifda...
Definition: exif.hpp:434