59 WRITE_TO_FILE_ONLY = 0,
62 WRITE_TO_SIDECAR_ONLY = 1,
65 WRITE_TO_SIDECAR_AND_FILE = 2,
68 WRITE_TO_SIDECAR_ONLY_FOR_READ_ONLY_FILES = 3
76 WORKSPACE_UNSPECIFIED = 0,
78 WORKSPACE_ADOBERGB = 2,
79 WORKSPACE_UNCALIBRATED = 65535
87 ORIENTATION_UNSPECIFIED = 0,
88 ORIENTATION_NORMAL = 1,
89 ORIENTATION_HFLIP = 2,
90 ORIENTATION_ROT_180 = 3,
91 ORIENTATION_VFLIP = 4,
92 ORIENTATION_ROT_90_HFLIP = 5,
93 ORIENTATION_ROT_90 = 6,
94 ORIENTATION_ROT_90_VFLIP = 7,
95 ORIENTATION_ROT_270 = 8
180 static bool initializeExiv2();
185 static bool supportXmp();
190 static bool supportJpegXL();
197 static bool supportBmff();
202 static bool supportMetadataWriting(
const QString& typeMime);
207 static QString Exiv2Version();
222 bool loadFromData(
const QByteArray& imgData);
229 bool loadFromDataAndMerge(
const QByteArray& imgData,
const QStringList& exclude = QStringList());
234 bool isEmpty()
const;
246 QSize getPixelSize()
const;
252 QString getMimeType()
const;
257 void setReadWithExifTool(
const bool on);
262 bool readWithExifTool()
const;
267 void setWriteWithExifTool(
const bool on);
272 bool writeWithExifTool()
const;
278 void setWriteRawFiles(
const bool on);
283 bool writeRawFiles()
const;
288 void setWriteDngFiles(
const bool on);
293 bool writeDngFiles()
const;
298 void setUseXMPSidecar4Reading(
const bool on);
303 bool useXMPSidecar4Reading()
const;
308 void setUseCompatibleFileName(
const bool on);
313 bool useCompatibleFileName()
const;
320 void setMetadataWritingMode(
const int mode);
327 int metadataWritingMode()
const;
333 void setUpdateFileTimeStamp(
bool on);
338 bool updateFileTimeStamp()
const;
349 void setFilePath(
const QString& path);
354 QString getFilePath()
const;
360 static QString sidecarFilePathForFile(
const QString& path);
365 static QString sidecarPath(
const QString& path);
370 static QUrl sidecarUrl(
const QUrl& url);
375 static QUrl sidecarUrl(
const QString& path);
380 static bool hasSidecar(
const QString& path);
386 static QString backendName(
Backend t);
394 bool load(
const QString& filePath,
Backend* backend =
nullptr);
400 bool loadFromSidecarAndMerge(
const QString& filePath);
406 bool save(
const QString& filePath,
bool setVersion =
false)
const;
412 bool applyChanges(
bool setVersion =
false)
const;
418 bool exportChanges(
const QString& exvTmpFile)
const;
430 bool setItemProgramId(
const QString& program,
const QString& version)
const;
436 QSize getItemDimensions()
const;
442 bool setItemDimensions(
const QSize& size)
const;
472 QDateTime getItemDateTime()
const;
478 bool setImageDateTime(
const QDateTime& dateTime,
bool setDateTimeDigitized =
false)
const;
485 QDateTime getDigitizationDateTime(
bool fallbackToCreationTime =
false)
const;
491 bool getItemPreview(QImage& preview)
const;
500 bool setItemPreview(
const QImage& preview)
const;
505 QByteArray getItemIccProfile()
const;
510 bool setItemIccProfile(
const QByteArray& iccData)
const;
521 static bool canWriteComment(
const QString& filePath);
526 bool hasComments()
const;
531 bool clearComments()
const;
538 QByteArray getComments()
const;
545 QString getCommentsDecoded()
const;
551 bool setComments(
const QByteArray& data)
const;
558 static QString detectLanguageAlt(
const QString&
value, QString& lang);
569 TagsMap getStdExifTagsList()
const;
574 TagsMap getMakernoteTagsList()
const;
579 static bool canWriteExif(
const QString& filePath);
584 bool hasExif()
const;
589 bool clearExif()
const;
599 QByteArray getExifEncoded(
bool addExifHeader =
false)
const;
605 bool setExif(
const QByteArray& data)
const;
612 QImage getExifThumbnail(
bool fixOrientation)
const;
624 bool setExifThumbnail(
const QImage& thumb)
const;
629 bool removeExifThumbnail()
const;
634 bool setTiffThumbnail(
const QImage& thumb)
const;
640 QString getExifComment(
bool readDescription =
true)
const;
646 QString getExifTagComment(
const char* exifTagName)
const;
652 bool setExifComment(
const QString& comment,
bool writeDescription =
true)
const;
658 QString getExifTagString(
const char* exifTagName,
bool escapeCR =
true)
const;
663 bool setExifTagString(
const char* exifTagName,
const QString&
value)
const;
668 bool getExifTagLong(
const char* exifTagName,
long &val)
const;
673 bool getExifTagLong(
const char* exifTagName,
long &val,
int component)
const;
678 bool setExifTagLong(
const char* exifTagName,
long val)
const;
683 bool setExifTagUShort(
const char* exifTagName,
unsigned int val)
const;
690 bool getExifTagRational(
const char* exifTagName,
long int& num,
long int& den,
int component = 0)
const;
697 bool setExifTagRational(
const char* exifTagName,
long int num,
long int den)
const;
704 bool setExifTagURational(
const char* exifTagName,
unsigned long int num,
unsigned long int den)
const;
710 QByteArray getExifTagData(
const char* exifTagName)
const;
715 bool setExifTagData(
const char* exifTagName,
const QByteArray& data)
const;
726 QVariant getExifTagVariant(
const char* exifTagName,
bool rationalAsListOfInts =
true,
727 bool escapeCR =
true,
int component = 0)
const;
736 bool setExifTagVariant(
const char* exifTagName,
const QVariant& data,
737 bool rationalWantSmallDenominator =
true)
const;
743 bool removeExifTag(
const char* exifTagName)
const;
748 QString getExifTagTitle(
const char* exifTagName);
753 QString getExifTagDescription(
const char* exifTagName);
761 QString createExifUserStringFromValue(
const char* exifTagName,
const QVariant& val,
bool escapeCR =
true);
788 bool invertSelection =
false,
789 bool extractBinary =
true)
const;
805 static bool canWriteIptc(
const QString& filePath);
810 bool hasIptc()
const;
815 bool clearIptc()
const;
822 QByteArray getIptc(
bool addIrbHeader =
false)
const;
828 bool setIptc(
const QByteArray& data)
const;
834 QString getIptcTagString(
const char* iptcTagName,
bool escapeCR =
true)
const;
839 bool setIptcTagString(
const char* iptcTagName,
const QString&
value)
const;
849 QStringList getIptcTagsStringList(
const char* iptcTagName,
bool escapeCR =
true)
const;
855 bool setIptcTagsStringList(
const char* iptcTagName,
int maxSize,
856 const QStringList& oldValues,
const QStringList& newValues)
const;
862 QByteArray getIptcTagData(
const char* iptcTagName)
const;
867 bool setIptcTagData(
const char* iptcTagName,
const QByteArray& data)
const;
873 bool removeIptcTag(
const char* iptcTagName)
const;
878 QString getIptcTagTitle(
const char* iptcTagName);
883 QString getIptcTagDescription(
const char* iptcTagName);
905 bool invertSelection =
false)
const;
910 QStringList getIptcKeywords()
const;
918 bool setIptcKeywords(
const QStringList& oldKeywords,
const QStringList& newKeywords)
const;
923 QStringList getIptcSubjects()
const;
931 bool setIptcSubjects(
const QStringList& oldSubjects,
const QStringList& newSubjects)
const;
937 QStringList getIptcSubCategories()
const;
945 bool setIptcSubCategories(
const QStringList& oldSubCategories,
const QStringList& newSubCategories)
const;
961 static bool canWriteXmp(
const QString& filePath);
971 bool clearXmp()
const;
977 QByteArray getXmp()
const;
983 bool setXmp(
const QByteArray& data)
const;
989 QString getXmpTagString(
const char* xmpTagName,
bool escapeCR =
true)
const;
994 bool setXmpTagString(
const char* xmpTagName,
const QString&
value)
const;
1001 bool setXmpTagString(
const char* xmpTagName,
const QString&
value,
1007 QString getXmpTagTitle(
const char* xmpTagName);
1012 QString getXmpTagDescription(
const char* xmpTagName);
1034 bool invertSelection =
false)
const;
1043 bool escapeCR =
true)
const;
1058 QString getXmpTagStringLangAlt(
const char* xmpTagName,
const QString& langAlt,
bool escapeCR)
const;
1066 bool setXmpTagStringLangAlt(
const char* xmpTagName,
const QString&
value,
1067 const QString& langAlt)
const;
1073 QStringList getXmpTagStringSeq(
const char* xmpTagName,
bool escapeCR =
true)
const;
1079 bool setXmpTagStringSeq(
const char* xmpTagName,
const QStringList& seq)
const;
1085 QStringList getXmpTagStringBag(
const char* xmpTagName,
bool escapeCR)
const;
1091 bool setXmpTagStringBag(
const char* xmpTagName,
const QStringList& bag)
const;
1099 bool addToXmpTagStringBag(
const char* xmpTagName,
const QStringList& entriesToAdd)
const;
1106 bool removeFromXmpTagStringBag(
const char* xmpTagName,
const QStringList& entriesToRemove)
const;
1119 QVariant getXmpTagVariant(
const char* xmpTagName,
bool rationalAsListOfInts =
true,
bool stringEscapeCR =
true)
const;
1124 QStringList getXmpKeywords()
const;
1132 bool setXmpKeywords(
const QStringList& newKeywords)
const;
1138 bool removeXmpKeywords(
const QStringList& keywordsToRemove);
1143 QStringList getXmpSubjects()
const;
1151 bool setXmpSubjects(
const QStringList& newSubjects)
const;
1157 bool removeXmpSubjects(
const QStringList& subjectsToRemove);
1163 QStringList getXmpSubCategories()
const;
1171 bool setXmpSubCategories(
const QStringList& newSubCategories)
const;
1177 bool removeXmpSubCategories(
const QStringList& categoriesToRemove);
1183 bool removeXmpTag(
const char* xmpTagName,
bool family =
false)
const;
1192 static bool registerXmpNameSpace(
const QString& uri,
const QString&
prefix);
1197 static bool unregisterXmpNameSpace(
const QString& uri);
1208 bool initializeGPSInfo();
1213 bool getGPSInfo(
double& altitude,
double& latitude,
double& longitude)
const;
1219 QString getGPSLatitudeString()
const;
1220 QString getGPSLongitudeString()
const;
1227 bool getGPSLatitudeNumber(
double*
const latitude)
const;
1228 bool getGPSLongitudeNumber(
double*
const longitude)
const;
1233 bool getGPSAltitude(
double*
const altitude)
const;
1239 bool setGPSInfo(
const double altitude,
const double latitude,
const double longitude);
1245 bool setGPSInfo(
const double*
const altitude,
const double latitude,
const double longitude);
1251 bool setGPSInfo(
const double altitude,
const QString& latitude,
const QString& longitude);
1257 bool removeGPSInfo();
1265 static void convertToRational(
const double number,
1266 long int*
const numerator,
1267 long int*
const denominator,
1268 const int rounding);
1278 static void convertToRationalSmallDenominator(
const double number,
1279 long int*
const numerator,
1280 long int*
const denominator);
1285 static double convertDegreeAngleToDouble(
double degrees,
double minutes,
double seconds);
1292 static QString convertToGPSCoordinateString(
const long int numeratorDegrees,
1293 const long int denominatorDegrees,
1294 const long int numeratorMinutes,
1295 const long int denominatorMinutes,
1296 const long int numeratorSeconds,
1297 const long int denominatorSeconds,
1298 const char directionReference);
1304 static QString convertToGPSCoordinateString(
const bool isLatitude,
1312 static bool convertFromGPSCoordinateString(
const QString& coordinate,
1313 long int*
const numeratorDegrees,
1314 long int*
const denominatorDegrees,
1315 long int*
const numeratorMinutes,
1316 long int*
const denominatorMinutes,
1317 long int*
const numeratorSeconds,
1318 long int*
const denominatorSeconds,
1319 char*
const directionReference);
1326 static bool convertFromGPSCoordinateString(
const QString& gpsString,
1327 double*
const coordinate);
1333 static bool convertToUserPresentableNumbers(
const QString& coordinate,
1336 double*
const seconds,
1337 char*
const directionReference);
1345 static void convertToUserPresentableNumbers(
const bool isLatitude,
1349 double*
const seconds,
1350 char*
const directionReference);
1360 bool setProgramId()
const;