 |
Exiv2
|
Go to the documentation of this file.
31 #include "exiv2lib_export.h"
53 #ifdef EXV_UNICODE_PATH
54 std::wstring wextension_;
100 const byte* pData()
const;
104 uint32_t size()
const;
116 #ifdef EXV_UNICODE_PATH
121 long writeFile(
const std::wstring& wpath)
const;
133 #ifdef EXV_UNICODE_PATH
139 std::wstring wextension()
const;
144 uint32_t width()
const;
148 uint32_t height()
const;
196 #endif // #ifndef PREVIEW_HPP_
virtual int open()=0
Open the IO source using the default access mode. The default mode should allow for reading and writi...
Provides binary IO on blocks of memory by implementing the BasicIo interface. A copy-on-write impleme...
Definition: basicio.hpp:540
byte * pData_
Pointer to the buffer, 0 if none has been allocated.
Definition: types.hpp:269
Utility class that closes a BasicIo instance upon destruction. Meant to be used as a stack variable i...
Definition: basicio.hpp:264
iterator findKey(const ExifKey &key)
Find the first Exifdatum with the given key, return an iterator to it.
Definition: exif.cpp:581
Common interface for all types of values used with metadata.
Definition: value.hpp:60
void add(const ExifKey &key, const Value *pValue)
Add an Exifdatum from the supplied key and value pair. This method copies (clones) key and value....
Definition: exif.cpp:564
PreviewId id() const
Return the preview image type identifier.
Definition: preview.cpp:1134
iterator begin()
Begin of the metadata.
Definition: exif.hpp:490
PreviewManager(const Image &image)
Constructor.
Definition: preview.cpp:1139
ExifMetadata::const_iterator const_iterator
ExifMetadata const iterator type.
Definition: exif.hpp:439
long writeFile(const std::string &path) const
Write the thumbnail image to a file.
Definition: preview.cpp:1074
@ undefined
Exif UNDEFINED type, an 8-bit byte that may contain anything.
Definition: types.hpp:137
EXV_WARN_UNUSED_RESULT std::pair< byte *, long > release()
Release ownership of the buffer to the caller. Returns the buffer as a data pointer and size pair,...
Definition: types.cpp:172
Native preview information. This is meant to be used only by the PreviewManager.
Definition: image.hpp:52
EXIV2API long writeFile(const DataBuf &buf, const std::string &path)
Write DataBuf buf to file path.
Definition: basicio.cpp:2702
Error class interface. Allows the definition and use of a hierarchy of error classes which can all be...
Definition: error.hpp:174
const NativePreviewList & nativePreviews() const
Return list of native previews. This is meant to be used only by the PreviewManager.
Definition: image.cpp:733
EXIV2API std::string strError()
Return a system error message and the error code (errno). See strerror(3).
Definition: futils.cpp:352
uint32_t height_
Preview image height in pixels or 0 for unknown height.
Definition: preview.hpp:62
std::vector< PreviewProperties > PreviewPropertiesList
Container type to hold all preview images metadata.
Definition: preview.hpp:68
Preview image properties.
Definition: preview.hpp:48
virtual long count() const =0
Return the number of components of the value.
#define EXV_COUNTOF(a)
Macro to determine the size of an array.
Definition: types.hpp:517
iterator end()
End of the metadata.
Definition: exif.hpp:492
Concrete keys for XMP metadata.
Definition: properties.hpp:241
~PreviewImage()
Destructor.
Definition: preview.cpp:1048
uint32_t width() const
Return the width of the preview image in pixels.
Definition: preview.cpp:1124
uint32_t height() const
Return the height of the preview image in pixels.
Definition: preview.cpp:1129
iterator findKey(const XmpKey &key)
Find the first Xmpdatum with the given key, return an iterator to it.
Definition: xmp.cpp:339
Port of D's enforce() to C++ & Exiv2.
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:893
const byte * pData() const
Return a pointer to the image data for read-only access.
Definition: preview.cpp:1097
uint32_t size_
Preview image size in bytes.
Definition: preview.hpp:58
Classes to access all preview images embedded in an image.
Internal class TiffParserWorker to parse TIFF data.
uint8_t byte
1 byte unsigned integer type.
Definition: types.hpp:105
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
Utility class containing a character array. All it does is to take care of memory allocation and dele...
Definition: types.hpp:204
PreviewPropertiesList getPreviewProperties() const
Return the properties of all preview images in a list sorted by preview width * height,...
Definition: preview.cpp:1144
Concrete keys for Exif metadata and access to Exif tag reference data.
Definition: tags.hpp:148
int PreviewId
Type of preview image.
Definition: preview.hpp:43
long size_
The current size of the buffer.
Definition: types.hpp:271
virtual long toLong(long n=0) const =0
Convert the n-th component of the value to a long. The behaviour of this method may be undefined if t...
virtual int setDataArea(const byte *buf, long len)
Set the data area, if the value has one by copying (cloning) the buffer pointed to by buf.
Definition: value.cpp:170
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
bool isTiffImageTag(uint16_t tag, IfdId group)
Convenience function to check if tag, group is in the list of TIFF image tags.
Definition: tiffimage_int.cpp:1873
PreviewImage(const PreviewImage &rhs)
Copy constructor.
Definition: preview.cpp:1053
uint32_t width_
Preview image width in pixels or 0 for unknown width.
Definition: preview.hpp:60
virtual std::string path() const =0
Return the path to the IO resource. Often used to form comprehensive error messages where only a Basi...
PreviewImage getPreviewImage(const PreviewProperties &properties) const
Return the preview image for the given preview properties.
Definition: preview.cpp:1161
static WriteMethod encode(BasicIo &io, const byte *pData, uint32_t size, ByteOrder byteOrder, const ExifData &exifData, const IptcData &iptcData, const XmpData &xmpData)
Encode metadata from the provided metadata to TIFF format.
Definition: tiffimage.cpp:268
Overflow checks for integers.
#define EXV_WARNING
Shorthand for a temp warning log message object and return its ostringstream.
Definition: error.hpp:148
XmpMetadata::const_iterator const_iterator
XmpMetadata const iterator type.
Definition: xmp_exiv2.hpp:181
Class that holds preview image properties and data buffer.
Definition: preview.hpp:73
virtual byte * mmap(bool isWriteable=false)=0
Direct access to the IO data. For files, this is done by mapping the file into the process's address ...
virtual size_t size() const =0
Get the current size of the IO source in bytes.
std::string extension_
Preview image extension.
Definition: preview.hpp:52
std::auto_ptr< Image > AutoPtr
Image auto_ptr type.
Definition: image.hpp:84
T add(T summand_1, T summand_2)
Safe addition, throws an exception on overflow.
Definition: safe_op.hpp:295
BasicError< char > Error
Error class used for exceptions (std::string based)
Definition: error.hpp:323
virtual long sizeDataArea() const
Return the size of the data area, 0 if there is none.
Definition: value.cpp:188
virtual byte * mmap(bool=false)
Allow direct access to the underlying data buffer. The buffer is not protected against write access i...
Definition: basicio.cpp:1339
A container for IPTC data. This is a top-level class of the Exiv2 library.
Definition: iptc.hpp:173
std::string mimeType() const
Return the MIME type of the preview image, usually either "image/tiff" or "image/jpeg".
Definition: preview.cpp:1107
@ string
IPTC string type.
Definition: types.hpp:147
std::string mimeType_
Preview image mime type.
Definition: preview.hpp:50
DataBuf copy() const
Return a copy of the preview image data. The caller owns this copy and DataBuf ensures that it will b...
Definition: preview.cpp:1092
std::string extension() const
Return the file extension for the format of the preview image (".tif" or ".jpg").
Definition: preview.cpp:1112
Class for extracting preview images from image metadata.
Definition: preview.hpp:168
virtual size_t size() const
Get the current memory buffer size in bytes.
Definition: basicio.cpp:1354
virtual std::string mimeType() const =0
Return the MIME type of the image.
PreviewId id_
Identifies type of preview image.
Definition: preview.hpp:64
std::string toString(const T &arg)
Utility function to convert the argument of any type to a string.
Definition: types.hpp:521
uint32_t size() const
Return the size of the preview image in bytes.
Definition: preview.cpp:1102
An interface for simple binary IO.
Definition: basicio.hpp:55
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
iterator end()
End of the metadata.
Definition: xmp.cpp:360
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
Basic file utility functions required by Exiv2.
virtual ExifData & exifData()
Returns an ExifData instance containing currently buffered Exif data.
Definition: image.cpp:551
Class JpegImage to access JPEG images.
PreviewImage & operator=(const PreviewImage &rhs)
Assignment operator.
Definition: preview.cpp:1061
A container for Exif data. This is a top-level class of the Exiv2 library. The container holds Exifda...
Definition: exif.hpp:434