Reads Exif metadata from a picture using libexiv2.
More...
|
using | TagMap = QMultiMap< QString, QStringList > |
|
static ImageMetaData * | FromPicture (const QString &filePath) |
| Factory to retrieve metadata from pictures. More...
|
|
static ImageMetaData * | FromVideo (const QString &filePath) |
| Factory to retrieve metadata from videos. More...
|
|
static QString | ToString (const QString &name, const QString &label, const QString &value) |
| Encodes metadata into a string as <tag name><tag label><tag value> More...
|
|
static QStringList | FromString (const QString &str) |
| Decodes metadata name, label, value from a string. More...
|
|
static TagMap | ToMap (const QStringList &tags) |
| Creates a map of metadata tags as. More...
|
|
static const QString | kSeparator = "|-|" |
| Unique separator to delimit fields within a string. More...
|
|
Reads Exif metadata from a picture using libexiv2.
Definition at line 258 of file imagemetadata.cpp.
◆ PictureMetaData()
PictureMetaData::PictureMetaData |
( |
const QString & |
filePath | ) |
|
|
explicit |
Constructor. Reads metadata from image.
- Parameters
-
filePath | Absolute image path |
Definition at line 285 of file imagemetadata.cpp.
◆ ~PictureMetaData()
PictureMetaData::~PictureMetaData |
( |
| ) |
|
|
overridedefault |
◆ IsValid()
bool PictureMetaData::IsValid |
( |
| ) |
|
|
inlineoverridevirtual |
◆ GetAllTags()
QStringList PictureMetaData::GetAllTags |
( |
| ) |
|
|
overridevirtual |
◆ GetOrientation()
int PictureMetaData::GetOrientation |
( |
bool * |
exists = nullptr | ) |
|
|
overridevirtual |
Read Exif orientation.
- Parameters
-
[out] | exists | (Optional) True if orientation is defined by metadata |
- Returns
- Exif orientation code
Implements ImageMetaData.
Definition at line 416 of file imagemetadata.cpp.
◆ GetOriginalDateTime()
QDateTime PictureMetaData::GetOriginalDateTime |
( |
bool * |
exists = nullptr | ) |
|
|
overridevirtual |
Read Exif timestamp of image capture.
- Parameters
-
[out] | exists | (Optional) True if date exists in metadata |
- Returns
- Timestamp (possibly invalid) in camera timezone
Implements ImageMetaData.
Definition at line 428 of file imagemetadata.cpp.
◆ GetComment()
QString PictureMetaData::GetComment |
( |
bool * |
exists = nullptr | ) |
|
|
overridevirtual |
Read Exif comments from metadata.
Returns UserComment, if not empty. Otherwise returns ImageDescription
- Parameters
-
[out] | exists | (Optional) True if either comment is found in metadata |
- Returns
- Comment as a string
Implements ImageMetaData.
Definition at line 444 of file imagemetadata.cpp.
◆ DecodeComment()
QString PictureMetaData::DecodeComment |
( |
std::string |
rawValue | ) |
|
|
staticprotected |
Decodes charset of UserComment.
- Parameters
-
rawValue | Metadata value with optional "[charset=...]" prefix |
- Returns
- Decoded comment
Definition at line 467 of file imagemetadata.cpp.
Referenced by GetAllTags(), and GetComment().
◆ GetTag()
std::string PictureMetaData::GetTag |
( |
const QString & |
key, |
|
|
bool * |
exists = nullptr |
|
) |
| |
|
protected |
◆ m_image
Exiv2::Image::UniquePtr PictureMetaData::m_image |
|
protected |
◆ m_exifData
Exiv2::ExifData PictureMetaData::m_exifData |
|
protected |
The documentation for this class was generated from the following file: