 |
Exiv2
|
24 #include "exiv2lib_export.h"
46 #ifdef EXV_UNICODE_PATH
47 std::wstring wextension_;
93 const byte* pData()
const;
97 uint32_t size()
const;
108 long writeFile(
const std::string& path)
const;
109 #ifdef EXV_UNICODE_PATH
114 long writeFile(
const std::wstring& wpath)
const;
120 std::string mimeType()
const;
125 std::string extension()
const;
126 #ifdef EXV_UNICODE_PATH
132 std::wstring wextension()
const;
137 uint32_t width()
const;
141 uint32_t height()
const;
189 #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:258
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:605
Common interface for all types of values used with metadata.
Definition: value.hpp:51
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:588
PreviewId id() const
Return the preview image type identifier.
Definition: preview.cpp:1136
iterator begin()
Begin of the metadata.
Definition: exif.hpp:490
PreviewManager(const Image &image)
Constructor.
Definition: preview.cpp:1141
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:1076
@ undefined
Exif UNDEFINED type, an 8-bit byte that may contain anything.
Definition: types.hpp:126
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:167
Native preview information. This is meant to be used only by the PreviewManager.
Definition: image.hpp:49
EXIV2API long writeFile(const DataBuf &buf, const std::string &path)
Write DataBuf buf to file path.
Definition: basicio.cpp:2703
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:762
EXIV2API std::string strError()
Return a system error message and the error code (errno). See strerror(3).
Definition: futils.cpp:316
uint32_t height_
Preview image height in pixels or 0 for unknown height.
Definition: preview.hpp:55
std::vector< PreviewProperties > PreviewPropertiesList
Container type to hold all preview images metadata.
Definition: preview.hpp:61
Preview image properties.
Definition: preview.hpp:41
virtual long count() const =0
Return the number of components of the value.
iterator end()
End of the metadata.
Definition: exif.hpp:492
Concrete keys for XMP metadata.
Definition: properties.hpp:230
~PreviewImage()
Destructor.
Definition: preview.cpp:1050
uint32_t width() const
Return the width of the preview image in pixels.
Definition: preview.cpp:1126
uint32_t height() const
Return the height of the preview image in pixels.
Definition: preview.cpp:1131
iterator findKey(const XmpKey &key)
Find the first Xmpdatum with the given key, return an iterator to it.
Definition: xmp.cpp:502
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
const byte * pData() const
Return a pointer to the image data for read-only access.
Definition: preview.cpp:1099
uint32_t size_
Preview image size in bytes.
Definition: preview.hpp:51
uint8_t byte
1 byte unsigned integer type.
Definition: types.hpp:94
Utility class containing a character array. All it does is to take care of memory allocation and dele...
Definition: types.hpp:193
PreviewPropertiesList getPreviewProperties() const
Return the properties of all preview images in a list sorted by preview width * height,...
Definition: preview.cpp:1146
Concrete keys for Exif metadata and access to Exif tag reference data.
Definition: tags.hpp:140
int PreviewId
Type of preview image.
Definition: preview.hpp:36
long size_
The current size of the buffer.
Definition: types.hpp:260
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:163
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:166
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:1993
PreviewImage(const PreviewImage &rhs)
Copy constructor.
Definition: preview.cpp:1055
uint32_t width_
Preview image width in pixels or 0 for unknown width.
Definition: preview.hpp:53
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:1163
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:275
#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:174
Class that holds preview image properties and data buffer.
Definition: preview.hpp:66
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:45
std::auto_ptr< Image > AutoPtr
Image auto_ptr type.
Definition: image.hpp:81
T add(T summand_1, T summand_2)
Safe addition, throws an exception on overflow.
Definition: safe_op.hpp:288
BasicError< char > Error
Error class used for exceptions (std::string based)
Definition: error.hpp:324
virtual long sizeDataArea() const
Return the size of the data area, 0 if there is none.
Definition: value.cpp:181
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:1338
A container for IPTC data. This is a top-level class of the Exiv2 library.
Definition: iptc.hpp:170
std::string mimeType() const
Return the MIME type of the preview image, usually either "image/tiff" or "image/jpeg".
Definition: preview.cpp:1109
std::string mimeType_
Preview image mime type.
Definition: preview.hpp:43
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:1094
std::string extension() const
Return the file extension for the format of the preview image (".tif" or ".jpg").
Definition: preview.cpp:1114
Class for extracting preview images from image metadata.
Definition: preview.hpp:161
virtual size_t size() const
Get the current memory buffer size in bytes.
Definition: basicio.cpp:1353
virtual std::string mimeType() const =0
Return the MIME type of the image.
PreviewId id_
Identifies type of preview image.
Definition: preview.hpp:57
std::string toString(const T &arg)
Utility function to convert the argument of any type to a string.
Definition: types.hpp:510
uint32_t size() const
Return the size of the preview image in bytes.
Definition: preview.cpp:1104
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:590
Abstract base class defining the interface for an image. This is the top-level interface to the Exiv2...
Definition: image.hpp:78
iterator end()
End of the metadata.
Definition: xmp.cpp:523
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:239
virtual ExifData & exifData()
Returns an ExifData instance containing currently buffered Exif data.
Definition: image.cpp:580
PreviewImage & operator=(const PreviewImage &rhs)
Assignment operator.
Definition: preview.cpp:1063
A container for Exif data. This is a top-level class of the Exiv2 library. The container holds Exifda...
Definition: exif.hpp:434