Go to the documentation of this file.
9 #ifndef IMAGEMETADATA_H
10 #define IMAGEMETADATA_H
15 #include <QCoreApplication>
17 #include <QStringBuilder>
18 #include <QStringList>
25 #define EXIF_TAG_ORIENTATION "Exif.Image.Orientation"
26 #define EXIF_TAG_DATETIME "Exif.Image.DateTime"
27 #define EXIF_TAG_DATE_FORMAT "yyyy:MM:dd hh:mm:ss"
28 #define EXIF_TAG_IMAGEDESCRIPTION "Exif.Image.ImageDescription"
29 #define EXIF_TAG_USERCOMMENT "Exif.Photo.UserComment"
30 #define EXIF_PRINT_IMAGE_MATCHING 0xc4a5
33 #define FFMPEG_TAG_ORIENTATION "rotate"
34 #define FFMPEG_TAG_DATETIME "creation_time"
35 #define FFMPEG_TAG_DATE_FORMAT "yyyy-MM-dd hh:mm:ss"
38 #define EXIF_MYTH_HOST "Myth.host"
39 #define EXIF_MYTH_PATH "Myth.path"
40 #define EXIF_MYTH_NAME "Myth.name"
41 #define EXIF_MYTH_SIZE "Myth.size"
42 #define EXIF_MYTH_ORIENT "Myth.orient"
67 : m_current(composite / 10), m_file(composite % 10) {}
71 int Composite()
const {
return m_current * 10 + m_file; }
73 int GetCurrent(
bool compensate);
74 QString Description()
const;
76 static int FromRotation(
const QString °rees);
79 static QString AsText(
int orientation);
81 int Apply(
int transform)
const;
83 using Matrix = QHash<int, QHash<int, int> >;
89 static Matrix InitOrientationMatrix();
112 static QString
ToString(
const QString &name,
const QString &label,
const QString &value)
113 {
return name % kSeparator % label % kSeparator % value; }
117 {
return str.split(kSeparator); }
119 using TagMap = QMultiMap<QString, QStringList>;
120 static TagMap ToMap(
const QStringList &tags);
122 virtual bool IsValid() = 0;
123 virtual QStringList GetAllTags() = 0;
124 virtual int GetOrientation(
bool *exists =
nullptr) = 0;
125 virtual QDateTime GetOriginalDateTime(
bool *exists =
nullptr) = 0;
126 virtual QString GetComment(
bool *exists =
nullptr) = 0;
130 : m_filePath(std::move(filePath)) {}
137 #endif // IMAGEMETADATA_H
Orientation(int current, int file)
QHash< int, QHash< int, int > > Matrix
int m_current
The orientation to use: the file orientation with user transformations applied.
static void Transform(SIMI *Simi, F_PT xo, F_PT yo, F_PT *x, F_PT *y)
Orientation(int composite)
int m_file
The orientation of the raw file image, as specified by the camera.
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
int Composite() const
Encode original & current orientation to a single Db field.
static const Matrix kQt541_orientation
Orientation conversions for proper display on Qt 5.4.1.
static const bool krunningQt541
True when using Qt 5.4.1 with its deviant orientation behaviour.
Encapsulates Exif orientation processing.