| digiKam Developer Documentation Professional Photo Management with the Power of Open Source

Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
Digikam::MetaEngine Class Reference
Inheritance diagram for Digikam::MetaEngine:

## Public Types
typedef QMap< QString, QString > | AltLangMap
| A map used to store a list of Alternative Language values.
enum | Backend { Exiv2Backend = 0 , LibRawBackend , LibHeifBackend , ImageMagickBackend , FFMpegBackend , ExifToolBackend , VideoMergeBackend , NoBackend }
| Metadata Backend used to populate information. More...
enum | ImageColorWorkSpace { WORKSPACE_UNSPECIFIED = 0 , WORKSPACE_SRGB = 1 , WORKSPACE_ADOBERGB = 2 , WORKSPACE_UNCALIBRATED = 65535 }
| The item color workspace values given by Exif metadata.
enum | ImageOrientation { ORIENTATION_UNSPECIFIED = 0 , ORIENTATION_NORMAL = 1 , ORIENTATION_HFLIP = 2 , ORIENTATION_ROT_180 = 3 , ORIENTATION_VFLIP = 4 , ORIENTATION_ROT_90_HFLIP = 5 , ORIENTATION_ROT_90 = 6 , ORIENTATION_ROT_90_VFLIP = 7 , ORIENTATION_ROT_270 = 8 }
| The item orientation values given by Exif metadata.
typedef QMap< QString, QString > | MetaDataMap
| A map used to store Tags Key and Tags Value.
enum | MetadataWritingMode { WRITE_TO_FILE_ONLY = 0 , WRITE_TO_SIDECAR_ONLY = 1 , WRITE_TO_SIDECAR_AND_FILE = 2 , WRITE_TO_SIDECAR_ONLY_FOR_READ_ONLY_FILES = 3 }
| The item metadata writing mode, between item file metadata and XMP sidecar file, depending on the context. More...
typedef QMap< QString, QStringList > | TagsMap
| A map used to store Tags Key and a list of Tags properties :
enum | XmpTagType { NormalTag = 0 , ArrayBagTag = 1 , StructureTag = 2 , ArrayLangTag = 3 , ArraySeqTag = 4 }
| Xmp tag types, used by setXmpTag, only first three types are used.

## Public Member Functions
| MetaEngine ()
| Standard constructor.
| MetaEngine (const MetaEngineData &data)
| Constructor to load from parsed data.
| MetaEngine (const QString &filePath)
| Constructor to Load Metadata from item file.
virtual | ~MetaEngine ()
| Standard destructor.
General methods
MetaEngineData | data () const
void | setData (const MetaEngineData &data)
bool | loadFromData (const QByteArray &imgData)
| Load all metadata (Exif, Iptc, Xmp, and JFIF Comments) from a byte array.
bool | loadFromDataAndMerge (const QByteArray &imgData, const QStringList &exclude=QStringList())
| Load and merge metadata (Exif, Iptc and Xmp) from a byte array.
bool | isEmpty () const
| Return 'true' if metadata container in memory as no Comments, Exif, Iptc, and Xmp.
QSize | getPixelSize () const
| Returns the pixel size of the current item.
QString | getMimeType () const
| Returns the mime type of this item.
void | setReadWithExifTool (const bool on)
| Enable or disable reading metadata operations with ExifTool.
bool | readWithExifTool () const
| Return true if reading metadata operations with ExifTool is enabled.
void | setWriteWithExifTool (const bool on)
| Enable or disable writing metadata operations with ExifTool.
bool | writeWithExifTool () const
| Return true if writing metadata operations with ExifTool is enabled.
void | setWriteRawFiles (const bool on)
| Enable or disable writing metadata operations to RAW files.
bool | writeRawFiles () const
| Return true if writing metadata operations on RAW files is enabled.
void | setWriteDngFiles (const bool on)
| Enable or disable writing metadata operations to DNG files.
bool | writeDngFiles () const
| Return true if writing metadata operations on DNG files is enabled.
void | setUseXMPSidecar4Reading (const bool on)
| Enable or disable using XMP sidecar for reading metadata.
bool | useXMPSidecar4Reading () const
| Return true if using XMP sidecar for reading metadata is enabled.
void | setUseCompatibleFileName (const bool on)
| Enable or disable using compatible file name for sidecar files.
bool | useCompatibleFileName () const
| Return true if using compatible file name for sidecar files.
void | setMetadataWritingMode (const int mode)
| Set metadata writing mode.
int | metadataWritingMode () const
| Return the metadata writing mode.
void | setUpdateFileTimeStamp (bool on)
| Enable or disable file timestamp updating when metadata are saved.
bool | updateFileTimeStamp () const
| Return true if file timestamp is updated when metadata are saved.
Metadata item information manipulation methods
bool | setItemProgramId (const QString &program, const QString &version) const
| Set Program name and program version in Exif and Iptc Metadata.
QSize | getItemDimensions () const
| Return the size of item in pixels using Exif tags.
bool | setItemDimensions (const QSize &size, bool setExifPixelXY=true) const
| Set the size of item in pixels in Exif tags.
MetaEngine::ImageOrientation | getItemOrientation () const
| Return the item orientation set in Exif metadata.
bool | setItemOrientation (ImageOrientation orientation) const
| Set the Exif orientation tag of item.
MetaEngine::ImageColorWorkSpace | getItemColorWorkSpace () const
| Return the item color-space set in Exif metadata.
bool | setItemColorWorkSpace (ImageColorWorkSpace workspace) const
| Set the Exif color-space tag of item.
QDateTime | getItemDateTime () const
| Return the time stamp of item.
bool | setImageDateTime (const QDateTime &dateTime, bool setDateTimeDigitized=false) const
| Set the Exif and Iptc time stamp.
QDateTime | getDigitizationDateTime (bool fallbackToCreationTime=false) const
| Return the digitization time stamp of the item.
bool | getItemPreview (QImage &preview) const
| Return a QImage copy of Iptc preview image.
bool | setItemPreview (const QImage &preview) const
| Set the Iptc preview image.
QByteArray | getItemIccProfile () const
| Get image ICC profile.
bool | setItemIccProfile (const QByteArray &iccData) const
| Set image ICC profile.

## Static Public Member Functions
Static methods
static bool | initializeExiv2 ()
| Return true if Exiv2 library initialization is done properly.
static bool | supportXmp ()
| Return true if Exiv2 library is compiled with Xmp metadata support.
static bool | supportJpegXL ()
| Return true if Exiv2 library is compiled with JpegXL metadata support.
static bool | supportBmff ()
| Return true if library support Base Media File Format (aka CR3, HEIF, HEIC, and AVIF).
static bool | supportMetadataWriting (const QString &typeMime)
| Return true if library can write metadata to typeMime file format.
static QString | Exiv2Version ()
| Return a string version of Exiv2 release in format "major.minor.patch".

## GPS manipulation methods
class | MetaEnginePreviews
bool | initializeGPSInfo ()
| Make sure all static required GPS EXIF and XMP tags exist.
bool | getGPSInfo (double &altitude, double &latitude, double &longitude) const
| Get all GPS location information set in item.
QString | getGPSLatitudeString () const
| Get GPS location information set in the item, in the GPSCoordinate format as described in the XMP specification.
QString | getGPSLongitudeString () const
bool | getGPSLatitudeNumber (double *const latitude) const
| Get GPS location information set in the item, as a double floating point number as in degrees where the sign determines the direction ref (North + / South - ; East + / West -).
bool | getGPSLongitudeNumber (double *const longitude) const
bool | getGPSAltitude (double *const altitude) const
| Get GPS altitude information, in meters, relative to sea level (positive sign above sea level)
bool | setGPSInfo (const double altitude, const double latitude, const double longitude)
| Set all GPS location information into item.
bool | setGPSInfo (const double *const altitude, const double latitude, const double longitude)
| Set all GPS location information into item.
bool | setGPSInfo (const double altitude, const QString &latitude, const QString &longitude)
| Set all GPS location information into item.
bool | removeGPSInfo ()
| Remove all Exif tags relevant of GPS location information.
static void | convertToRational (const double number, long int *const numerator, long int *const denominator, const int rounding)
| This method converts 'number' to a rational value, returned in the 'numerator' and 'denominator' parameters.
static void | convertToRationalSmallDenominator (const double number, long int *const numerator, long int *const denominator)
| This method convert a 'number' to a rational value, returned in 'numerator' and 'denominator' parameters.
static double | convertDegreeAngleToDouble (double degrees, double minutes, double seconds)
| Converts degrees values as a double representation.
static QString | convertToGPSCoordinateString (const long int numeratorDegrees, const long int denominatorDegrees, const long int numeratorMinutes, const long int denominatorMinutes, const long int numeratorSeconds, const long int denominatorSeconds, const char directionReference)
| Converts a GPS position stored as rationals in Exif to the form described as GPSCoordinate in the XMP specification, either in the from "256,45,34N" or "256,45.566667N".
static QString | convertToGPSCoordinateString (const bool isLatitude, double coordinate)
| Converts a GPS position stored as double floating point number in degrees to the form described as GPSCoordinate in the XMP specification.
static bool | convertFromGPSCoordinateString (const QString &coordinate, long int *const numeratorDegrees, long int *const denominatorDegrees, long int *const numeratorMinutes, long int *const denominatorMinutes, long int *const numeratorSeconds, long int *const denominatorSeconds, char *const directionReference)
| Converts a GPSCoordinate string as defined by XMP to three rationals and the direction reference.
static bool | convertFromGPSCoordinateString (const QString &gpsString, double *const coordinate)
| Convert a GPSCoordinate string as defined by XMP to a double floating point number in degrees where the sign determines the direction ref (North + / South - ; East + / West -).
static bool | convertToUserPresentableNumbers (const QString &coordinate, int *const degrees, int *const minutes, double *const seconds, char *const directionReference)
| Converts a GPSCoordinate string to user presentable numbers, integer degrees and minutes and double floating point seconds, and a direction reference ('N' or 'S', 'E' or 'W')
static void | convertToUserPresentableNumbers (const bool isLatitude, double coordinate, int *const degrees, int *const minutes, double *const seconds, char *const directionReference)
| Converts a double floating point number to user presentable numbers, integer degrees and minutes and double floating point seconds, and a direction reference ('N' or 'S', 'E' or 'W').
bool | setProgramId () const
| Set the Program Name and Program Version information in Exif and Iptc metadata.

## File I/O methods
void | setFilePath (const QString &path)
| Set the file path of current item.
QString | getFilePath () const
| Return the file path of current item.
bool | load (const QString &filePath, Backend *backend=nullptr)
| Load all metadata (Exif, Iptc, Xmp, and JFIF Comments) from a picture (JPEG, RAW, TIFF, PNG, DNG, etc...).
bool | loadFromSidecarAndMerge (const QString &filePath)
| Load metadata from a sidecar file and merge.
virtual bool | save (const QString &filePath, bool setVersion=false) const
| Save all metadata to a file.
virtual bool | applyChanges (bool setVersion=false) const
| The same than save() method, but it apply on current item.
bool | exportChanges (const QString &exvTmpFile) const
| Export metadata to a temporary EXV file container.
static QString | sidecarFilePathForFile (const QString &path)
| Return the XMP Sidecar file path for a item file path.
static QString | sidecarPath (const QString &path)
| Like sidecarFilePathForFile(), but works for local file path.
static QUrl | sidecarUrl (const QUrl &url)
| Like sidecarFilePathForFile(), but works for remote URLs.
static QUrl | sidecarUrl (const QString &path)
| Gives a file url for a local path.
static bool | hasSidecar (const QString &path)
| Performs a QFileInfo based check if the given local file has a sidecar.
static QString | backendName (Backend t)
| Return a string of backend name used to parse metadata from file.

## Comments manipulation methods
bool | hasComments () const
| Return 'true' if metadata container in memory as Comments.
bool | clearComments () const
| Clear the Comments metadata container in memory.
QByteArray | getComments () const
| Return a Qt byte array copy of Comments container get from current item.
QString | getCommentsDecoded () const
| Return a Qt string object of Comments from current item decoded using the 'detectEncodingAndDecode()' method.
bool | setComments (const QByteArray &data) const
| Set the Comments data using a Qt byte array.
static bool | canWriteComment (const QString &filePath)
| Return 'true' if Comments can be written in file.
static QString | detectLanguageAlt (const QString &value, QString &lang)
| Language Alternative autodetection.

## Exif manipulation methods
TagsMap | getStdExifTagsList () const
| Return a map of all standard Exif tags supported by Exiv2.
TagsMap | getMakernoteTagsList () const
| Return a map of all non-standard Exif tags (makernotes) supported by Exiv2.
bool | hasExif () const
| Return 'true' if metadata container in memory as Exif.
bool | clearExif () const
| Clear the Exif metadata container in memory.
QByteArray | getExifEncoded (bool addExifHeader=false) const
| Returns the exif data encoded to a QByteArray in a form suitable for storage in a JPEG image.
bool | setExif (const QByteArray &data) const
| Set the Exif data using a Qt byte array.
QImage | getExifThumbnail (bool fixOrientation) const
| Return a QImage copy of Exif thumbnail image.
bool | rotateExifQImage (QImage &image, ImageOrientation orientation) const
| Fix orientation of a QImage image accordingly with Exif orientation tag.
bool | setExifThumbnail (const QImage &thumb) const
| Set the Exif Thumbnail image.
bool | removeExifThumbnail () const
| Remove the Exif Thumbnail from the item.
bool | setTiffThumbnail (const QImage &thumb) const
| Adds a JPEG thumbnail to a TIFF images.
QString | getExifComment (bool readDescription=true) const
| Return a QString copy of Exif user comments.
QString | getExifTagComment (const char *exifTagName) const
| Return a Exif tag comment like a string.
bool | setExifComment (const QString &comment, bool writeDescription=true) const
| Set the Exif user comments from item.
QString | getExifTagString (const char *exifTagName, bool escapeCR=true) const
| Get an Exif tags content like a string.
bool | setExifTagString (const char *exifTagName, const QString &value) const
| Set an Exif tag content using a string.
bool | getExifTagLong (const char *exifTagName, long &val) const
| Get an Exif tag content like a long value.
bool | getExifTagLong (const char *exifTagName, long &val, int component) const
| Get an Exif tag content like a long value.
bool | setExifTagLong (const char *exifTagName, long val) const
| Set an Exif tag content using a long value.
bool | setExifTagUShort (const char *exifTagName, unsigned int val) const
| Set an Exif tag content using a unsigned short value.
bool | getExifTagRational (const char *exifTagName, long int &num, long int &den, int component=0) const
| Get the 'component' index of an Exif tags content like a rational value.
bool | setExifTagRational (const char *exifTagName, long int num, long int den) const
| Set an Exif tag content using a rational value.
bool | setExifTagURational (const char *exifTagName, unsigned long int num, unsigned long int den) const
| Set an Exif tag content using a unsigned rational value.
QByteArray | getExifTagData (const char *exifTagName) const
| Get an Exif tag content like a bytes array.
bool | setExifTagData (const char *exifTagName, const QByteArray &data) const
| Set an Exif tag content using a bytes array.
QVariant | getExifTagVariant (const char *exifTagName, bool rationalAsListOfInts=true, bool escapeCR=true, int component=0) const
| Get an Exif tags content as a QVariant.
bool | setExifTagVariant (const char *exifTagName, const QVariant &data, bool rationalWantSmallDenominator=true) const
| Set an Exif tag content using a QVariant.
bool | removeExifTag (const char *exifTagName) const
| Remove the Exif tag 'exifTagName' from Exif metadata.
QString | getExifTagTitle (const char *exifTagName)
| Return the Exif Tag title or a null string.
QString | getExifTagDescription (const char *exifTagName)
| Return the Exif Tag description or a null string.
QString | createExifUserStringFromValue (const char *exifTagName, const QVariant &val, bool escapeCR=true)
| Takes a QVariant value as it could have been retrieved by getExifTagVariant with the given exifTagName, and returns its value properly converted to a string (including translations from Exiv2).
MetaEngine::MetaDataMap | getExifTagsDataList (const QStringList &exifKeysFilter=QStringList(), bool invertSelection=false, bool extractBinary=true) const
| Return a map of Exif tags name/value found in metadata sorted by Exif keys given by 'exifKeysFilter'.
static bool | canWriteExif (const QString &filePath)
| Return 'true' if Exif can be written in file.

## IPTC manipulation methods
MetaEngine::TagsMap | getIptcTagsList () const
| Return a map of all standard Iptc tags supported by Exiv2.
bool | hasIptc () const
| Return 'true' if metadata container in memory as Iptc.
bool | clearIptc () const
| Clear the Iptc metadata container in memory.
QByteArray | getIptc (bool addIrbHeader=false) const
| Return a Qt byte array copy of Iptc container get from current item.
bool | setIptc (const QByteArray &data) const
| Set the Iptc data using a Qt byte array.
QString | getIptcTagString (const char *iptcTagName, bool escapeCR=true) const
| Get an Iptc tag content like a string.
bool | setIptcTagString (const char *iptcTagName, const QString &value) const
| Set an Iptc tag content using a string.
QStringList | getIptcTagsStringList (const char *iptcTagName, bool escapeCR=true) const
| Returns a strings list with of multiple Iptc tags from the item.
bool | setIptcTagsStringList (const char *iptcTagName, int maxSize, const QStringList &oldValues, const QStringList &newValues) const
| Set multiple Iptc tags contents using a strings list.
QByteArray | getIptcTagData (const char *iptcTagName) const
| Get an Iptc tag content as a bytes array.
bool | setIptcTagData (const char *iptcTagName, const QByteArray &data) const
| Set an Iptc tag content using a bytes array.
bool | removeIptcTag (const char *iptcTagName) const
| Remove the all instance of Iptc tags 'iptcTagName' from Iptc metadata.
QString | getIptcTagTitle (const char *iptcTagName)
| Return the Iptc Tag title or a null string.
QString | getIptcTagDescription (const char *iptcTagName)
| Return the Iptc Tag description or a null string.
MetaEngine::MetaDataMap | getIptcTagsDataList (const QStringList &iptcKeysFilter=QStringList(), bool invertSelection=false) const
| Return a map of Iptc tags name/value found in metadata sorted by Iptc keys given by 'iptcKeysFilter'.
QStringList | getIptcKeywords () const
| Return a strings list of Iptc keywords from item.
bool | setIptcKeywords (const QStringList &oldKeywords, const QStringList &newKeywords) const
| Set Iptc keywords using a list of strings defined by 'newKeywords' parameter.
QStringList | getIptcSubjects () const
| Return a strings list of Iptc subjects from item.
bool | setIptcSubjects (const QStringList &oldSubjects, const QStringList &newSubjects) const
| Set Iptc subjects using a list of strings defined by 'newSubjects' parameter.
QStringList | getIptcSubCategories () const
| Return a strings list of Iptc sub-categories from item.
bool | setIptcSubCategories (const QStringList &oldSubCategories, const QStringList &newSubCategories) const
| Set Iptc sub-categories using a list of strings defined by 'newSubCategories' parameter.
static bool | canWriteIptc (const QString &filePath)
| Return 'true' if Iptc can be written in file.

## XMP manipulation methods
MetaEngine::TagsMap | getXmpTagsList () const
| Return a map of all standard Xmp tags supported by Exiv2.
bool | hasXmp () const
| Return 'true' if metadata container in memory as Xmp.
bool | clearXmp () const
| Clear the Xmp metadata container in memory.
QByteArray | getXmp () const
| Return a Qt byte array copy of XMp container get from current item.
bool | setXmp (const QByteArray &data) const
| Set the Xmp data using a Qt byte array.
QString | getXmpTagString (const char *xmpTagName, bool escapeCR=true) const
| Get a Xmp tag content like a string.
bool | setXmpTagString (const char *xmpTagName, const QString &value) const
| Set a Xmp tag content using a string.
bool | setXmpTagString (const char *xmpTagName, const QString &value, XmpTagType type) const
| Set a Xmp tag with a specific type.
QString | getXmpTagTitle (const char *xmpTagName)
| Return the Xmp Tag title or a null string.
QString | getXmpTagDescription (const char *xmpTagName)
| Return the Xmp Tag description or a null string.
MetaEngine::MetaDataMap | getXmpTagsDataList (const QStringList &xmpKeysFilter=QStringList(), bool invertSelection=false) const
| Return a map of Xmp tags name/value found in metadata sorted by Xmp keys given by 'xmpKeysFilter'.
MetaEngine::AltLangMap | getXmpTagStringListLangAlt (const char *xmpTagName, bool escapeCR=true) const
| Get all redondant Alternative Language Xmp tags content like a map.
bool | setXmpTagStringListLangAlt (const char *xmpTagName, const MetaEngine::AltLangMap &values) const
| Set an Alternative Language Xmp tag content using a map.
QString | getXmpTagStringLangAlt (const char *xmpTagName, const QString &langAlt, bool escapeCR) const
| Get a Xmp tag content like a string set with an alternative language header 'langAlt' (like "fr-FR" for French - RFC3066 notation) If 'escapeCR' parameter is true, the CR characters will be removed.
bool | setXmpTagStringLangAlt (const char *xmpTagName, const QString &value, const QString &langAlt) const
| Set a Xmp tag content using a string with an alternative language header.
QStringList | getXmpTagStringSeq (const char *xmpTagName, bool escapeCR=true) const
| Get a Xmp tag content like a sequence of strings.
bool | setXmpTagStringSeq (const char *xmpTagName, const QStringList &seq) const
| Set a Xmp tag content using the sequence of strings 'seq'.
QStringList | getXmpTagStringBag (const char *xmpTagName, bool escapeCR) const
| Get a Xmp tag content like a bag of strings.
bool | setXmpTagStringBag (const char *xmpTagName, const QStringList &bag) const
| Set a Xmp tag content using the bag of strings 'bag'.
bool | addToXmpTagStringBag (const char *xmpTagName, const QStringList &entriesToAdd) const
| Set an Xmp tag content using a list of strings defined by the 'entriesToAdd' parameter.
bool | removeFromXmpTagStringBag (const char *xmpTagName, const QStringList &entriesToRemove) const
| Remove those Xmp tag entries that are listed in entriesToRemove from the entries in metadata.
QVariant | getXmpTagVariant (const char *xmpTagName, bool rationalAsListOfInts=true, bool stringEscapeCR=true) const
| Get an Xmp tag content as a QVariant.
QStringList | getXmpKeywords () const
| Return a strings list of Xmp keywords from item.
bool | setXmpKeywords (const QStringList &newKeywords) const
| Set Xmp keywords using a list of strings defined by 'newKeywords' parameter.
bool | removeXmpKeywords (const QStringList &keywordsToRemove)
| Remove those Xmp keywords that are listed in keywordsToRemove from the keywords in metadata.
QStringList | getXmpSubjects () const
| Return a strings list of Xmp subjects from item.
bool | setXmpSubjects (const QStringList &newSubjects) const
| Set Xmp subjects using a list of strings defined by 'newSubjects' parameter.
bool | removeXmpSubjects (const QStringList &subjectsToRemove)
| Remove those Xmp subjects that are listed in subjectsToRemove from the subjects in metadata.
QStringList | getXmpSubCategories () const
| Return a strings list of Xmp sub-categories from item.
bool | setXmpSubCategories (const QStringList &newSubCategories) const
| Set Xmp sub-categories using a list of strings defined by 'newSubCategories' parameter.
bool | removeXmpSubCategories (const QStringList &categoriesToRemove)
| Remove those Xmp sub-categories that are listed in categoriesToRemove from the sub-categories in metadata.
bool | removeXmpTag (const char *xmpTagName, bool family=false) const
| Remove the Xmp tag 'xmpTagName' from Xmp metadata.
static bool | canWriteXmp (const QString &filePath)
| Return 'true' if Xmp can be written in file.
static bool | registerXmpNameSpace (const QString &uri, const QString &prefix)
| Register a namespace which Exiv2 doesn't know yet.
static bool | unregisterXmpNameSpace (const QString &uri)
| Unregister a previously registered custom namespace.

## Member Typedef Documentation

## ◆ AltLangMap

typedef QMap<QString, QString> Digikam::MetaEngine::AltLangMap

The map key is the language code following RFC3066 notation (like "fr-FR" for French), and the map value the text.

## ◆ TagsMap

typedef QMap<QString, QStringList> Digikam::MetaEngine::TagsMap

- name,
- title,
- description.

## Member Enumeration Documentation

## ◆ Backend

enum Digikam::MetaEngine::Backend

Enumerator
Exiv2Backend | Default backend used by MetaEngine.
LibRawBackend | DMetadata only.
LibHeifBackend | DMetadata only.
ImageMagickBackend | DMetadata only.
FFMpegBackend | DMetadata only.
ExifToolBackend | DMetadata only.
VideoMergeBackend | DMetadata only.
NoBackend | No backend used (aka file cannot be read).

## ◆ MetadataWritingMode

enum Digikam::MetaEngine::MetadataWritingMode

See also
  MetadataWritingMode(), metadataWritingMode()

Enumerator
WRITE_TO_FILE_ONLY | Write metadata to item file only.
WRITE_TO_SIDECAR_ONLY | Write metadata to sidecar file only.
WRITE_TO_SIDECAR_AND_FILE | Write metadata to item and sidecar files.
WRITE_TO_SIDECAR_ONLY_FOR_READ_ONLY_FILES | Write metadata to sidecar file only for read only items such as RAW files for example.

## Member Function Documentation

## ◆ addToXmpTagStringBag()

bool Digikam::MetaEngine::addToXmpTagStringBag | ( | const char * | xmpTagName,
|  | const QStringList & | entriesToAdd
| ) |  | const

The existing entries are preserved. The method will compare all new with all already existing entries to prevent duplicates in the item. Return true if the entries have been added to metadata.

## ◆ applyChanges()

bool Digikam::MetaEngine::applyChanges | ( | bool | setVersion = `false` | ) | const
| virtual

Return true if metadata have been saved into file.

Reimplemented in Digikam::DMetadata.

## ◆ backendName()

QString Digikam::MetaEngine::backendName | ( | Backend | t | ) |
| static

See Backend enum for details.

## ◆ convertDegreeAngleToDouble()

double Digikam::MetaEngine::convertDegreeAngleToDouble | ( | double | degrees,
|  | double | minutes,
|  | double | seconds
| ) |  |
| static

This code take a care about hemisphere position.

## ◆ convertFromGPSCoordinateString() [1/2]

bool Digikam::MetaEngine::convertFromGPSCoordinateString | ( | const QString & | coordinate,
|  | long int *const | numeratorDegrees,
|  | long int *const | denominatorDegrees,
|  | long int *const | numeratorMinutes,
|  | long int *const | denominatorMinutes,
|  | long int *const | numeratorSeconds,
|  | long int *const | denominatorSeconds,
|  | char *const | directionReference
| ) |  |
| static

Returns true if the conversion was successful. If minutes is given in the fractional form, a denominator of 1000000 for the minutes will be used.

## ◆ convertFromGPSCoordinateString() [2/2]

bool Digikam::MetaEngine::convertFromGPSCoordinateString | ( | const QString & | gpsString,
|  | double *const | coordinate
| ) |  |
| static

Returns true if the conversion was successful.

## ◆ convertToGPSCoordinateString()

QString Digikam::MetaEngine::convertToGPSCoordinateString | ( | const long int | numeratorDegrees,
|  | const long int | denominatorDegrees,
|  | const long int | numeratorMinutes,
|  | const long int | denominatorMinutes,
|  | const long int | numeratorSeconds,
|  | const long int | denominatorSeconds,
|  | const char | directionReference
| ) |  |
| static

Precision: A second at sea level measures 30m for our purposes, a minute 1800m. (for more details, see https://en.wikipedia.org/wiki/Geographic_coordinate_system) This means with a decimal precision of 8 for minutes we get +/-0,018mm. (if I calculated correctly)

## ◆ convertToRational()

void Digikam::MetaEngine::convertToRational | ( | const double | number,
|  | long int *const | numerator,
|  | long int *const | denominator,
|  | const int | rounding
| ) |  |
| static

Set the precision using 'rounding' parameter. Use this method if you want to retrieve a most exact rational for a number without further properties, without any requirements to the denominator.

## ◆ convertToRationalSmallDenominator()

void Digikam::MetaEngine::convertToRationalSmallDenominator | ( | const double | number,
|  | long int *const | numerator,
|  | long int *const | denominator
| ) |  |
| static

This method will be able to retrieve a rational number from a double - if you constructed your double with 1.0 / 4786.0, this method will retrieve 1 / 4786. If your number is not expected to be rational, use the method above which is just as exact with rounding = 4 and more exact with rounding > 4.

## ◆ convertToUserPresentableNumbers()

void Digikam::MetaEngine::convertToUserPresentableNumbers | ( | const bool | isLatitude,
|  | double | coordinate,
|  | int *const | degrees,
|  | int *const | minutes,
|  | double *const | seconds,
|  | char *const | directionReference
| ) |  |
| static

The method needs to know for the direction reference if the latitude or the longitude is meant by the double parameter.

## ◆ createExifUserStringFromValue()

QString Digikam::MetaEngine::createExifUserStringFromValue | ( | const char * | exifTagName,
|  | const QVariant & | val,
|  | bool | escapeCR = `true`
| ) |  |

This is equivalent to calling getExifTagString directly. If escapeCR is true CR characters will be removed from the result.

## ◆ detectLanguageAlt()

QString Digikam::MetaEngine::detectLanguageAlt | ( | const QString & | value,
|  | QString & | lang
| ) |  |
| static

Return a QString without language alternative header. Header is saved into 'lang'. If no language alternative is founf, value is returned as well and 'lang' is set to a null string.

## ◆ exportChanges()

bool Digikam::MetaEngine::exportChanges | ( | const QString & | exvTmpFile | ) | const

'exvTmpFile' is the path to the temporary EXV container to create.

## ◆ getComments()

QByteArray Digikam::MetaEngine::getComments | ( |  | ) | const

Comments are JFIF section of JPEG images. Look Exiv2 API for more information. Return a null Qt byte array if there is no Comments metadata in memory.

## ◆ getCommentsDecoded()

QString Digikam::MetaEngine::getCommentsDecoded | ( |  | ) | const

Return a null string if there is no Comments metadata available.

## ◆ getDigitizationDateTime()

QDateTime Digikam::MetaEngine::getDigitizationDateTime | ( | bool | fallbackToCreationTime = `false` | ) | const

First Exif information is checked, then IPTC. If no digitization time stamp is found, getItemDateTime() is called if fallbackToCreationTime is true, or a null QDateTime is returned if fallbackToCreationTime is false.

## ◆ getExifComment()

QString Digikam::MetaEngine::getExifComment | ( | bool | readDescription = `true` | ) | const

Return a null string if user comments cannot be found.

## ◆ getExifEncoded()

QByteArray Digikam::MetaEngine::getExifEncoded | ( | bool | addExifHeader = `false` | ) | const

Note that this encoding is a lossy operation.

Set true 'addExifHeader' parameter to add an Exif header to Exif metadata. Returns a null Qt byte array if there is no Exif metadata in memory.

## ◆ getExifTagComment()

QString Digikam::MetaEngine::getExifTagComment | ( | const char * | exifTagName | ) | const

Return a null string if user comments cannot be found.

## ◆ getExifTagData()

QByteArray Digikam::MetaEngine::getExifTagData | ( | const char * | exifTagName | ) | const

Return an empty bytes array if Exif tag cannot be found.

## ◆ getExifTagLong() [1/2]

bool Digikam::MetaEngine::getExifTagLong | ( | const char * | exifTagName,
|  | long & | val
| ) |  | const

Return true if Exif tag be found.

## ◆ getExifTagLong() [2/2]

bool Digikam::MetaEngine::getExifTagLong | ( | const char * | exifTagName,
|  | long & | val,
|  | int | component
| ) |  | const

Return true if Exif tag be found.

## ◆ getExifTagRational()

bool Digikam::MetaEngine::getExifTagRational | ( | const char * | exifTagName,
|  | long int & | num,
|  | long int & | den,
|  | int | component = `0`
| ) |  | const

'num' and 'den' are the numerator and the denominator of the rational value. Return true if Exif tag be found.

## ◆ getExifTagsDataList()

MetaEngine::MetaDataMap Digikam::MetaEngine::getExifTagsDataList | ( | const QStringList & | exifKeysFilter = `QStringList()`,
|  | bool | invertSelection = `false`,
|  | bool | extractBinary = `true`
| ) |  | const

'exifKeysFilter' is a QStringList of Exif keys. For example, if you use the string list given below:

"Iop" "Thumbnail" "Image" "Photo"

List can be empty to not filter output.

... this method will return a map of all Exif tags which :

- include "Iop", or "Thumbnail", or "Image", or "Photo" in the Exif tag keys if 'inverSelection' is false.
- not include "Iop", or "Thumbnail", or "Image", or "Photo" in the Exif tag keys if 'inverSelection' is true. if 'extractBinary" is true, tags with undefined types of data are extracted (default), else contents is replaced by "Binary data ... bytes". Take a care as large binary data as original RAW data from DNG container can be huge and listing Exif tags from GUI can take a while.

## ◆ getExifTagString()

QString Digikam::MetaEngine::getExifTagString | ( | const char * | exifTagName,
|  | bool | escapeCR = `true`
| ) |  | const

If 'escapeCR' parameter is true, the CR characters will be removed. If Exif tag cannot be found a null string is returned.

## ◆ getExifTagVariant()

QVariant Digikam::MetaEngine::getExifTagVariant | ( | const char * | exifTagName,
|  | bool | rationalAsListOfInts = `true`,
|  | bool | escapeCR = `true`,
|  | int | component = `0`
| ) |  | const

Returns a null QVariant if the Exif tag cannot be found. For string and integer values the matching QVariant types will be used, for date and time values QVariant::DateTime. Rationals will be returned as QVariant::List with two integer QVariants (numerator, denominator) if rationalAsListOfInts is true, as double if rationalAsListOfInts is false. An exif tag of numerical type may contain more than one value; set component to the desired index.

## ◆ getExifThumbnail()

QImage Digikam::MetaEngine::getExifThumbnail | ( | bool | fixOrientation | ) | const

Return a null image if thumbnail cannot be found. The 'fixOrientation' parameter will rotate automatically the thumbnail if Exif orientation tags information are attached with thumbnail.

## ◆ getGPSInfo()

bool Digikam::MetaEngine::getGPSInfo | ( | double & | altitude,
|  | double & | latitude,
|  | double & | longitude
| ) |  | const

Return true if all information can be found.

## ◆ getGPSLatitudeNumber()

bool Digikam::MetaEngine::getGPSLatitudeNumber | ( | double *const | latitude | ) | const

Returns true if the information is available.

## ◆ getGPSLatitudeString()

QString Digikam::MetaEngine::getGPSLatitudeString | ( |  | ) | const

Returns a null string in the information cannot be found.

## ◆ getIptc()

QByteArray Digikam::MetaEngine::getIptc | ( | bool | addIrbHeader = `false` | ) | const

Set true 'addIrbHeader' parameter to add an Irb header to Iptc metadata. Return a null Qt byte array if there is no Iptc metadata in memory.

## ◆ getIptcKeywords()

QStringList Digikam::MetaEngine::getIptcKeywords | ( |  | ) | const

Return an empty list if no keyword are set.

## ◆ getIptcSubCategories()

QStringList Digikam::MetaEngine::getIptcSubCategories | ( |  | ) | const

Return an empty list if no sub-category are set.

## ◆ getIptcSubjects()

QStringList Digikam::MetaEngine::getIptcSubjects | ( |  | ) | const

Return an empty list if no subject are set.

## ◆ getIptcTagData()

QByteArray Digikam::MetaEngine::getIptcTagData | ( | const char * | iptcTagName | ) | const

Return an empty bytes array if Iptc tag cannot be found.

## ◆ getIptcTagsDataList()

MetaEngine::MetaDataMap Digikam::MetaEngine::getIptcTagsDataList | ( | const QStringList & | iptcKeysFilter = `QStringList()`,
|  | bool | invertSelection = `false`
| ) |  | const

'iptcKeysFilter' is a QStringList of Iptc keys. For example, if you use the string list given below:

"Envelope" "Application2"

List can be empty to not filter output.

... this method will return a map of all Iptc tags which :

- include "Envelope", or "Application2" in the Iptc tag keys if 'inverSelection' is false.
- not include "Envelope", or "Application2" in the Iptc tag keys if 'inverSelection' is true.

## ◆ getIptcTagsStringList()

QStringList Digikam::MetaEngine::getIptcTagsStringList | ( | const char * | iptcTagName,
|  | bool | escapeCR = `true`
| ) |  | const

Return an empty list if no tag is found. Get the values of all IPTC tags with the given tag name in a string list. (In Iptc, there can be multiple tags with the same name) If the 'escapeCR' parameter is true, the CR characters will be removed. If no tag can be found an empty list is returned.

## ◆ getIptcTagString()

QString Digikam::MetaEngine::getIptcTagString | ( | const char * | iptcTagName,
|  | bool | escapeCR = `true`
| ) |  | const

If 'escapeCR' parameter is true, the CR characters will be removed. If Iptc tag cannot be found a null string is returned.

## ◆ getItemColorWorkSpace()

MetaEngine::ImageColorWorkSpace Digikam::MetaEngine::getItemColorWorkSpace | ( |  | ) | const

The makernotes of item are also parsed to get this information. See ImageColorWorkSpace values for details.

## ◆ getItemDateTime()

QDateTime Digikam::MetaEngine::getItemDateTime | ( |  | ) | const

Exif information are check in first, IPTC in second if item don't have Exif information. If no time stamp is found, a null date is returned.

## ◆ getItemDimensions()

QSize Digikam::MetaEngine::getItemDimensions | ( |  | ) | const

Return a null dimension if size cannot be found.

## ◆ getItemOrientation()

MetaEngine::ImageOrientation Digikam::MetaEngine::getItemOrientation | ( |  | ) | const

The makernotes of item are also parsed to get this information. See ImageOrientation values for details.

## ◆ getItemPreview()

bool Digikam::MetaEngine::getItemPreview | ( | QImage & | preview | ) | const

Return a null item if preview cannot be found.

## ◆ getMimeType()

QString Digikam::MetaEngine::getMimeType | ( |  | ) | const

The information is read from the file; see the docs for getPixelSize() to know when it is available.

## ◆ getPixelSize()

QSize Digikam::MetaEngine::getPixelSize | ( |  | ) | const

This information is read from the file, not from the metadata. The returned QSize is valid if the MetaEngine object was constructed by reading a file or item data; the information is not available when the object was created from MetaEngineData. Note that in the Exif or XMP metadata, there may be fields describing the item size. These fields are not accessed by this method. When replacing the metadata with setData(), the metadata may change; this information always keeps referring to the file it was initially read from.

## ◆ getXmp()

QByteArray Digikam::MetaEngine::getXmp | ( |  | ) | const

Return a null Qt byte array if there is no Xmp metadata in memory.

## ◆ getXmpKeywords()

QStringList Digikam::MetaEngine::getXmpKeywords | ( |  | ) | const

Return an empty list if no keyword are set.

## ◆ getXmpSubCategories()

QStringList Digikam::MetaEngine::getXmpSubCategories | ( |  | ) | const

Return an empty list if no sub-category are set.

## ◆ getXmpSubjects()

QStringList Digikam::MetaEngine::getXmpSubjects | ( |  | ) | const

Return an empty list if no subject are set.

## ◆ getXmpTagsDataList()

MetaEngine::MetaDataMap Digikam::MetaEngine::getXmpTagsDataList | ( | const QStringList & | xmpKeysFilter = `QStringList()`,
|  | bool | invertSelection = `false`
| ) |  | const

'xmpKeysFilter' is a QStringList of Xmp keys. For example, if you use the string list given below:

"dc" // Dublin Core schema. "xmp" // Standard Xmp schema.

List can be empty to not filter output.

... this method will return a map of all Xmp tags which :

- include "dc", or "xmp" in the Xmp tag keys if 'inverSelection' is false.
- not include "dc", or "xmp" in the Xmp tag keys if 'inverSelection' is true.

## ◆ getXmpTagString()

QString Digikam::MetaEngine::getXmpTagString | ( | const char * | xmpTagName,
|  | bool | escapeCR = `true`
| ) |  | const

If 'escapeCR' parameter is true, the CR characters will be removed. If Xmp tag cannot be found a null string is returned.

## ◆ getXmpTagStringBag()

QStringList Digikam::MetaEngine::getXmpTagStringBag | ( | const char * | xmpTagName,
|  | bool | escapeCR
| ) |  | const

If 'escapeCR' parameter is true, the CR characters will be removed from strings. If Xmp tag cannot be found a null string list is returned.

## ◆ getXmpTagStringLangAlt()

QString Digikam::MetaEngine::getXmpTagStringLangAlt | ( | const char * | xmpTagName,
|  | const QString & | langAlt,
|  | bool | escapeCR
| ) |  | const

If Xmp tag cannot be found a null string is returned.

## ◆ getXmpTagStringListLangAlt()

MetaEngine::AltLangMap Digikam::MetaEngine::getXmpTagStringListLangAlt | ( | const char * | xmpTagName,
|  | bool | escapeCR = `true`
| ) |  | const

See AltLangMap class description for details. If 'escapeCR' parameter is true, the CR characters will be removed from strings. If Xmp tag cannot be found a null string list is returned.

## ◆ getXmpTagStringSeq()

QStringList Digikam::MetaEngine::getXmpTagStringSeq | ( | const char * | xmpTagName,
|  | bool | escapeCR = `true`
| ) |  | const

If 'escapeCR' parameter is true, the CR characters will be removed from strings. If Xmp tag cannot be found a null string list is returned.

## ◆ getXmpTagVariant()

QVariant Digikam::MetaEngine::getXmpTagVariant | ( | const char * | xmpTagName,
|  | bool | rationalAsListOfInts = `true`,
|  | bool | stringEscapeCR = `true`
| ) |  | const

Returns a null QVariant if the Xmp tag cannot be found. For string and integer values the matching QVariant types will be used, for date and time values QVariant::DateTime. Rationals will be returned as QVariant::List with two integer QVariants (numerator, denominator) if rationalAsListOfInts is true, as double if rationalAsListOfInts is false. Arrays (ordered, unordered, alternative) are returned as type StringList. LangAlt values will have type Map (QMap<QString, QVariant>) with the language code as key and the contents as value, of type String.

## ◆ initializeExiv2()

bool Digikam::MetaEngine::initializeExiv2 | ( |  | ) |
| static

This method must be called before using libMetaEngine with multithreading. It initialize several non re-entrancy code from Adobe XMP SDK, and register a function to cleanup automatically all XMP SDK memory allocation. See Bug #166424 for details.

It cleans up memory used by Adobe XMP SDK automatically at application exit. See Bug #166424 for details.

## ◆ load()

bool Digikam::MetaEngine::load | ( | const QString & | filePath,
|  | Backend * | backend = `nullptr`
| ) |  |

Return true if metadata have been loaded successfully from file. If backend is non null, return the backend used to populate metadata (Exiv2). See Backend enum for details.

## ◆ loadFromData()

bool Digikam::MetaEngine::loadFromData | ( | const QByteArray & | imgData | ) |

Return true if metadata have been loaded successfully from item data.

## ◆ loadFromDataAndMerge()

bool Digikam::MetaEngine::loadFromDataAndMerge | ( | const QByteArray & | imgData,
|  | const QStringList & | exclude = `QStringList()`
| ) |  |

Use 'exclude' to remove Exif tags from the 'imgData' that will not be merged. Return true if metadata have been loaded and merged successfully from item data.

## ◆ loadFromSidecarAndMerge()

bool Digikam::MetaEngine::loadFromSidecarAndMerge | ( | const QString & | filePath | ) |

Return true if metadata have been loaded successfully from file.

## ◆ metadataWritingMode()

int Digikam::MetaEngine::metadataWritingMode | ( |  | ) | const

Returns
  Metadata writing mode as defined by the MetadataWritingMode enum.

See also
  MetadataWritingMode, setMetadataWritingMode()

## ◆ registerXmpNameSpace()

bool Digikam::MetaEngine::registerXmpNameSpace | ( | const QString & | uri,
|  | const QString & | prefix
| ) |  |
| static

This is only needed when new Xmp properties are added manually. 'uri' is the namespace url and 'prefix' the string used to construct new Xmp key (ex. "Xmp.digiKam.tagList").

Note
  If the Xmp metadata is read from an item, namespaces are decoded and registered by Exiv2 at the same time.

## ◆ removeExifTag()

bool Digikam::MetaEngine::removeExifTag | ( | const char * | exifTagName | ) | const

Return true if tag is removed successfully or if no tag was present.

## ◆ removeFromXmpTagStringBag()

bool Digikam::MetaEngine::removeFromXmpTagStringBag | ( | const char * | xmpTagName,
|  | const QStringList & | entriesToRemove
| ) |  | const

Return true if tag entries are no longer contained in metadata. All other entries are preserved.

## ◆ removeGPSInfo()

bool Digikam::MetaEngine::removeGPSInfo | ( |  | ) |

Return true if all tags have been removed successfully in metadata.

NOTE: The XMP spec does not mention Xmp.exif.GPSLongitudeRef, and Xmp.exif.GPSLatitudeRef. But because we write historicaly until 7.6.0 release them in setGPSInfo(), we should also remove them here. See bug #450982.

## ◆ removeIptcTag()

bool Digikam::MetaEngine::removeIptcTag | ( | const char * | iptcTagName | ) | const

Return true if all tags have been removed successfully (or none were present).

## ◆ removeXmpKeywords()

bool Digikam::MetaEngine::removeXmpKeywords | ( | const QStringList & | keywordsToRemove | ) |

Return true if keywords are no longer contained in metadata.

## ◆ removeXmpSubCategories()

bool Digikam::MetaEngine::removeXmpSubCategories | ( | const QStringList & | categoriesToRemove | ) |

Return true if subjects are no longer contained in metadata.

## ◆ removeXmpSubjects()

bool Digikam::MetaEngine::removeXmpSubjects | ( | const QStringList & | subjectsToRemove | ) |

Return true if subjects are no longer contained in metadata.

## ◆ removeXmpTag()

bool Digikam::MetaEngine::removeXmpTag | ( | const char * | xmpTagName,
|  | bool | family = `false`
| ) |  | const

Return true if tag is removed successfully or if no tag was present.

## ◆ rotateExifQImage()

bool Digikam::MetaEngine::rotateExifQImage | ( | QImage & | image,
|  | ImageOrientation | orientation
| ) |  | const

Return true if image is rotated, else false.

## ◆ save()

bool Digikam::MetaEngine::save | ( | const QString & | filePath,
|  | bool | setVersion = `false`
| ) |  | const
| virtual

This one can be different than original picture to perform transfer operation Return true if metadata have been saved into file.

Reimplemented in Digikam::DMetadata.

## ◆ setComments()

bool Digikam::MetaEngine::setComments | ( | const QByteArray & | data | ) | const

Return true if Comments metadata have been changed in memory.

## ◆ setExif()

bool Digikam::MetaEngine::setExif | ( | const QByteArray & | data | ) | const

Return true if Exif metadata have been changed in memory.

## ◆ setExifComment()

bool Digikam::MetaEngine::setExifComment | ( | const QString & | comment,
|  | bool | writeDescription = `true`
| ) |  | const

Look Exif specification for more details about this tag. Return true if Exif user comments have been changed in metadata.

## ◆ setExifTagData()

bool Digikam::MetaEngine::setExifTagData | ( | const char * | exifTagName,
|  | const QByteArray & | data
| ) |  | const

Return true if tag is set successfully.

## ◆ setExifTagLong()

bool Digikam::MetaEngine::setExifTagLong | ( | const char * | exifTagName,
|  | long | val
| ) |  | const

Return true if tag is set successfully.

## ◆ setExifTagRational()

bool Digikam::MetaEngine::setExifTagRational | ( | const char * | exifTagName,
|  | long int | num,
|  | long int | den
| ) |  | const

'num' and 'den' are the numerator and the denominator of the rational value. Return true if tag is set successfully.

## ◆ setExifTagString()

bool Digikam::MetaEngine::setExifTagString | ( | const char * | exifTagName,
|  | const QString & | value
| ) |  | const

Return true if tag is set successfully.

## ◆ setExifTagURational()

bool Digikam::MetaEngine::setExifTagURational | ( | const char * | exifTagName,
|  | unsigned long int | num,
|  | unsigned long int | den
| ) |  | const

'num' and 'den' are the numerator and the denominator of the unsigned rational value. Return true if tag is set successfully.

## ◆ setExifTagUShort()

bool Digikam::MetaEngine::setExifTagUShort | ( | const char * | exifTagName,
|  | unsigned int | val
| ) |  | const

Return true if tag is set successfully.

## ◆ setExifTagVariant()

bool Digikam::MetaEngine::setExifTagVariant | ( | const char * | exifTagName,
|  | const QVariant & | data,
|  | bool | rationalWantSmallDenominator = `true`
| ) |  | const

Returns true if tag is set successfully. All types described for the getExifTagVariant() method are supported. Calling with a QVariant of type ByteArray is equivalent to calling setExifTagData. For the meaning of rationalWantSmallDenominator, see the documentation of the convertToRational methods. Setting a value with multiple components is currently not supported.

## ◆ setExifThumbnail()

bool Digikam::MetaEngine::setExifThumbnail | ( | const QImage & | thumb | ) | const

The thumbnail image must have the right dimensions before. Look Exif specification for details. Return true if thumbnail have been changed in metadata.

## ◆ setGPSInfo() [1/3]

bool Digikam::MetaEngine::setGPSInfo | ( | const double *const | altitude,
|  | const double | latitude,
|  | const double | longitude
| ) |  |

Return true if all information have been changed in metadata. If you do not want altitude to be set, pass a null pointer.

NOTE: The XMP spec does not mention Xmp.exif.GPSLatitudeRef, because the reference is included in Xmp.exif.GPSLatitude. See bug #450982.

NOTE: The XMP spec does not mention Xmp.exif.GPSLongitudeRef, because the reference is included in Xmp.exif.GPSLongitude. See bug #450982.

## ◆ setGPSInfo() [2/3]

bool Digikam::MetaEngine::setGPSInfo | ( | const double | altitude,
|  | const double | latitude,
|  | const double | longitude
| ) |  |

Return true if all information have been changed in metadata.

## ◆ setGPSInfo() [3/3]

bool Digikam::MetaEngine::setGPSInfo | ( | const double | altitude,
|  | const QString & | latitude,
|  | const QString & | longitude
| ) |  |

Return true if all information have been changed in metadata.

## ◆ setImageDateTime()

bool Digikam::MetaEngine::setImageDateTime | ( | const QDateTime & | dateTime,
|  | bool | setDateTimeDigitized = `false`
| ) |  | const

If 'setDateTimeDigitized' parameter is true, the 'Digitalized' time stamp is set, else only 'Created' time stamp is set.

## ◆ setIptc()

bool Digikam::MetaEngine::setIptc | ( | const QByteArray & | data | ) | const

Return true if Iptc metadata have been changed in memory.

## ◆ setIptcKeywords()

bool Digikam::MetaEngine::setIptcKeywords | ( | const QStringList & | oldKeywords,
|  | const QStringList & | newKeywords
| ) |  | const

Use 'getImageKeywords()' method to set 'oldKeywords' parameter with existing keywords from item. The method will compare all new keywords with all old keywords to prevent duplicate entries in item. Return true if keywords have been changed in metadata.

## ◆ setIptcSubCategories()

bool Digikam::MetaEngine::setIptcSubCategories | ( | const QStringList & | oldSubCategories,
|  | const QStringList & | newSubCategories
| ) |  | const

Use 'getImageSubCategories()' method to set 'oldSubCategories' parameter with existing sub-categories from item. The method will compare all new sub-categories with all old sub-categories to prevent duplicate entries in item. Return true if sub-categories have been changed in metadata.

## ◆ setIptcSubjects()

bool Digikam::MetaEngine::setIptcSubjects | ( | const QStringList & | oldSubjects,
|  | const QStringList & | newSubjects
| ) |  | const

Use 'getImageSubjects()' method to set 'oldSubjects' parameter with existing subjects from item. The method will compare all new subjects with all old subjects to prevent duplicate entries in item. Return true if subjects have been changed in metadata.

## ◆ setIptcTagData()

bool Digikam::MetaEngine::setIptcTagData | ( | const char * | iptcTagName,
|  | const QByteArray & | data
| ) |  | const

Return true if tag is set successfully.

## ◆ setIptcTagsStringList()

bool Digikam::MetaEngine::setIptcTagsStringList | ( | const char * | iptcTagName,
|  | int | maxSize,
|  | const QStringList & | oldValues,
|  | const QStringList & | newValues
| ) |  | const

'maxSize' is the max characters size of one entry. Return true if all tags have been set successfully.

## ◆ setIptcTagString()

bool Digikam::MetaEngine::setIptcTagString | ( | const char * | iptcTagName,
|  | const QString & | value
| ) |  | const

Return true if tag is set successfully.

## ◆ setItemColorWorkSpace()

bool Digikam::MetaEngine::setItemColorWorkSpace | ( | ImageColorWorkSpace | workspace | ) | const

See ImageColorWorkSpace values for details Return true if work-space have been changed in metadata.

## ◆ setItemDimensions()

bool Digikam::MetaEngine::setItemDimensions | ( | const QSize & | size,
|  | bool | setExifPixelXY = `true`
| ) |  | const

Return true if size have been changed in metadata.

## ◆ setItemOrientation()

bool Digikam::MetaEngine::setItemOrientation | ( | ImageOrientation | orientation | ) | const

See ImageOrientation values for details Return true if orientation have been changed in metadata.

## ◆ setItemPreview()

bool Digikam::MetaEngine::setItemPreview | ( | const QImage & | preview | ) | const

The thumbnail item must have the right size before (64Kb max with JPEG file, else 256Kb). Look Iptc specification for details. Return true if preview have been changed in metadata. Re-implement this method if you want to use another item file format than JPEG to save preview.

## ◆ setItemProgramId()

bool Digikam::MetaEngine::setItemProgramId | ( | const QString & | program,
|  | const QString & | version
| ) |  | const

Return true if information have been changed in metadata.

## ◆ setMetadataWritingMode()

void Digikam::MetaEngine::setMetadataWritingMode | ( | const int | mode | ) |

Parameters

  mode | Metadata writing mode as defined by the MetadataWritingMode enum.

See also
  MetadataWritingMode, metadataWritingMode()

## ◆ setTiffThumbnail()

bool Digikam::MetaEngine::setTiffThumbnail | ( | const QImage & | thumb | ) | const

Use this instead of setExifThumbnail for TIFF images.

## ◆ setUpdateFileTimeStamp()

void Digikam::MetaEngine::setUpdateFileTimeStamp | ( | bool | on | ) |

By default files timestamp are untouched.

## ◆ setWriteRawFiles()

void Digikam::MetaEngine::setWriteRawFiles | ( | const bool | on | ) |

By default RAW files are untouched.

## ◆ setXmp()

bool Digikam::MetaEngine::setXmp | ( | const QByteArray & | data | ) | const

Return true if Xmp metadata have been changed in memory.

## ◆ setXmpKeywords()

bool Digikam::MetaEngine::setXmpKeywords | ( | const QStringList & | newKeywords | ) | const

The existing keywords from item are preserved. The method will compare all new keywords with all already existing keywords to prevent duplicate entries in item. Return true if keywords have been changed in metadata.

## ◆ setXmpSubCategories()

bool Digikam::MetaEngine::setXmpSubCategories | ( | const QStringList & | newSubCategories | ) | const

The existing sub-categories from item are preserved. The method will compare all new sub-categories with all already existing sub-categories to prevent duplicate entries in item. Return true if sub-categories have been changed in metadata.

## ◆ setXmpSubjects()

bool Digikam::MetaEngine::setXmpSubjects | ( | const QStringList & | newSubjects | ) | const

The existing subjects from item are preserved. The method will compare all new subject with all already existing subject to prevent duplicate entries in item. Return true if subjects have been changed in metadata.

## ◆ setXmpTagString() [1/2]

bool Digikam::MetaEngine::setXmpTagString | ( | const char * | xmpTagName,
|  | const QString & | value
| ) |  | const

Return true if tag is set successfully.

## ◆ setXmpTagString() [2/2]

bool Digikam::MetaEngine::setXmpTagString | ( | const char * | xmpTagName,
|  | const QString & | value,
|  | MetaEngine::XmpTagType | type
| ) |  | const

Return true if tag is set successfully. This method only accept NormalTag, ArrayBagTag and StructureTag. Other XmpTagTypes do nothing

## ◆ setXmpTagStringBag()

bool Digikam::MetaEngine::setXmpTagStringBag | ( | const char * | xmpTagName,
|  | const QStringList & | bag
| ) |  | const

Return true if tag is set successfully.

## ◆ setXmpTagStringLangAlt()

bool Digikam::MetaEngine::setXmpTagStringLangAlt | ( | const char * | xmpTagName,
|  | const QString & | value,
|  | const QString & | langAlt
| ) |  | const

'langAlt' contain the language alternative information (like "fr-FR" for French - RFC3066 notation) or is null to set alternative language to default settings ("x-default"). Return true if tag is set successfully.

## ◆ setXmpTagStringListLangAlt()

bool Digikam::MetaEngine::setXmpTagStringListLangAlt | ( | const char * | xmpTagName,
|  | const MetaEngine::AltLangMap & | values
| ) |  | const

See AltLangMap class description for details. If tag already exist, it will be removed before. Return true if tag is set successfully.

## ◆ setXmpTagStringSeq()

bool Digikam::MetaEngine::setXmpTagStringSeq | ( | const char * | xmpTagName,
|  | const QStringList & | seq
| ) |  | const

Return true if tag is set successfully.

## ◆ sidecarFilePathForFile()

QString Digikam::MetaEngine::sidecarFilePathForFile | ( | const QString & | path | ) |
| static

If item file path do not include a file name or is empty, this function return a null string.

## ◆ supportBmff()

bool Digikam::MetaEngine::supportBmff | ( |  | ) |
| static

Note: use this function only after to call initializeExiv2(), else false will always returned. The function return true only if Exiv2 >= 0.27.4 compiled with BMFF support.