Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #ifndef QUILL_METADATA_H
00041 #define QUILL_METADATA_H
00042
00043 #include <QString>
00044 #include <QVariant>
00045
00046 class QuillMetadataPrivate;
00047
00048 class QuillMetadata
00049 {
00050 public:
00051
00052 enum Tag {
00054 Tag_Make,
00056 Tag_Model,
00058 Tag_ImageWidth,
00060 Tag_ImageHeight,
00062 Tag_FocalLength,
00064 Tag_ExposureTime,
00066 Tag_TimestampOriginal,
00068 Tag_Title,
00070 Tag_Copyright,
00072 Tag_Creator,
00074 Tag_Keywords,
00076 Tag_Subject,
00078 Tag_City,
00080 Tag_Country,
00082 Tag_Location,
00084 Tag_Rating,
00086 Tag_Timestamp,
00088 Tag_Orientation,
00090 Tag_Description,
00092 Tag_GPSLatitude,
00094 Tag_GPSLatitudeRef,
00096 Tag_GPSLongitude,
00098 Tag_GPSLongitudeRef,
00100 Tag_GPSAltitude,
00102 Tag_GPSAltitudeRef,
00104 Tag_GPSVersionID,
00106 Tag_GPSImgDirection,
00108 Tag_GPSImgDirectionRef,
00110 Tag_Undefined,
00111 };
00112
00113 enum TagGroup {
00115 TagGroup_All = 0,
00117 TagGroup_GPS
00118 };
00119
00124 enum MetadataFormatFlags {
00126 ExifFormat = 0x1,
00128 XmpFormat = 0x2,
00130 AllFormats = ~1
00131 };
00132
00133 public:
00137 QuillMetadata();
00138
00148 QuillMetadata(const QString &fileName,
00149 MetadataFormatFlags formats = AllFormats);
00150
00162 explicit QuillMetadata(const QString &fileName,
00163 MetadataFormatFlags formats,
00164 Tag tagToRead);
00165
00169 ~QuillMetadata();
00170
00178 static bool canRead(const QString &filePath);
00179
00183 bool isValid() const;
00184
00189 QVariant entry(Tag tag) const;
00190
00196 void setEntry(Tag tag, const QVariant &entry);
00197
00202 void removeEntry(Tag tag);
00203
00209 void removeEntries(const QList<Tag> &tags);
00210
00216 void removeEntries(TagGroup tagGroup);
00217
00233 bool write(const QString &filePath,
00234 MetadataFormatFlags formats = AllFormats) const;
00235
00243 QByteArray dump(MetadataFormatFlags formats) const;
00244
00245 private:
00246 void init();
00247
00248 private:
00249 QuillMetadataPrivate *priv;
00250 };
00251
00252 #endif