KExiv2Iface::KExiv2

Search for usage in LXR

KExiv2Iface::KExiv2 Class Reference

#include <KExiv2/KExiv2>

Public Types

typedef QMap< QString, QStringAltLangMap
 
enum  ImageColorWorkSpace { WORKSPACE_UNSPECIFIED = 0 , WORKSPACE_SRGB = 1 , WORKSPACE_ADOBERGB = 2 , WORKSPACE_UNCALIBRATED = 65535 }
 
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
}
 
typedef QMap< QString, QStringMetaDataMap
 
enum  MetadataWritingMode { WRITETOIMAGEONLY = 0 , WRITETOSIDECARONLY = 1 , WRITETOSIDECARANDIMAGE = 2 , WRITETOSIDECARONLY4READONLYFILES = 3 }
 
typedef QMap< QString, QStringListTagsMap
 
enum  XmpTagType {
  NormalTag = 0 , ArrayBagTag = 1 , StructureTag = 2 , ArrayLangTag = 3 ,
  ArraySeqTag = 4
}
 

Public Member Functions

 KExiv2 ()
 
 KExiv2 (const KExiv2 &metadata)
 
 KExiv2 (const KExiv2Data &data)
 
 KExiv2 (const QString &filePath)
 
virtual ~KExiv2 ()
 
KExiv2operator= (const KExiv2 &metadata)
 
General methods
KExiv2Data data () const
 
void setData (const KExiv2Data &data)
 
bool loadFromData (const QByteArray &imgData) const
 
virtual bool load (const QString &filePath) const
 
bool save (const QString &filePath) const
 
bool applyChanges () const
 
bool isEmpty () const
 
void setFilePath (const QString &path)
 
QString getFilePath () const
 
QSize getPixelSize () const
 
QString getMimeType () const
 
void setWriteRawFiles (const bool on)
 
bool writeRawFiles () const
 
void setUseXMPSidecar4Reading (const bool on)
 
bool useXMPSidecar4Reading () const
 
void setMetadataWritingMode (const int mode)
 
int metadataWritingMode () const
 
void setUpdateFileTimeStamp (bool on)
 
bool updateFileTimeStamp () const
 
Metadata image information manipulation methods
bool setImageProgramId (const QString &program, const QString &version) const
 
QSize getImageDimensions () const
 
bool setImageDimensions (const QSize &size, bool setProgramName=true) const
 
KExiv2::ImageOrientation getImageOrientation () const
 
bool setImageOrientation (ImageOrientation orientation, bool setProgramName=true) const
 
KExiv2::ImageColorWorkSpace getImageColorWorkSpace () const
 
bool setImageColorWorkSpace (ImageColorWorkSpace workspace, bool setProgramName=true) const
 
QDateTime getImageDateTime () const
 
bool setImageDateTime (const QDateTime &dateTime, bool setDateTimeDigitized=false, bool setProgramName=true) const
 
QDateTime getDigitizationDateTime (bool fallbackToCreationTime=false) const
 
bool getImagePreview (QImage &preview) const
 
virtual bool setImagePreview (const QImage &preview, bool setProgramName=true) const
 

Static Public Member Functions

Static methods
static bool initializeExiv2 ()
 
static bool cleanupExiv2 ()
 
static bool supportXmp ()
 
static bool supportMetadataWritting (const QString &typeMime)
 
static QString Exiv2Version ()
 
static QString version ()
 
static QString sidecarFilePathForFile (const QString &path)
 
static QString sidecarPath (const QString &path)
 
static QUrl sidecarUrl (const QUrl &url)
 
static QUrl sidecarUrl (const QString &path)
 
static bool hasSidecar (const QString &path)
 

GPS manipulation methods

bool initializeGPSInfo (const bool setProgramName)
 
bool getGPSInfo (double &altitude, double &latitude, double &longitude) const
 
QString getGPSLatitudeString () const
 
QString getGPSLongitudeString () const
 
bool getGPSLatitudeNumber (double *const latitude) const
 
bool getGPSLongitudeNumber (double *const longitude) const
 
bool getGPSAltitude (double *const altitude) const
 
bool setGPSInfo (const double altitude, const double latitude, const double longitude, const bool setProgramName=true)
 
bool setGPSInfo (const double *const altitude, const double latitude, const double longitude, const bool setProgramName=true)
 
bool setGPSInfo (const double altitude, const QString &latitude, const QString &longitude, const bool setProgramName=true)
 
bool removeGPSInfo (const bool setProgramName=true)
 
static void convertToRational (const double number, long int *const numerator, long int *const denominator, const int rounding)
 
static void convertToRationalSmallDenominator (const double number, long int *const numerator, long int *const denominator)
 
static QString convertToGPSCoordinateString (const long int numeratorDegrees, const long int denominatorDegrees, const long int numeratorMinutes, const long int denominatorMinutes, const long int numeratorSeconds, long int denominatorSeconds, const char directionReference)
 
static QString convertToGPSCoordinateString (const bool isLatitude, double coordinate)
 
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)
 
static bool convertFromGPSCoordinateString (const QString &gpsString, double *const coordinate)
 
static bool convertToUserPresentableNumbers (const QString &coordinate, int *const degrees, int *const minutes, double *const seconds, char *const directionReference)
 
static void convertToUserPresentableNumbers (const bool isLatitude, double coordinate, int *const degrees, int *const minutes, double *const seconds, char *const directionReference)
 
virtual bool setProgramId (bool on=true) const
 

Comments manipulation methods

bool hasComments () const
 
bool clearComments () const
 
QByteArray getComments () const
 
QString getCommentsDecoded () const
 
bool setComments (const QByteArray &data) const
 
static bool canWriteComment (const QString &filePath)
 
static QString detectLanguageAlt (const QString &value, QString &lang)
 

Exif manipulation methods

TagsMap getStdExifTagsList () const
 
TagsMap getMakernoteTagsList () const
 
bool hasExif () const
 
bool clearExif () const
 
QByteArray getExifEncoded (bool addExifHeader=false) const
 
bool setExif (const QByteArray &data) const
 
QImage getExifThumbnail (bool fixOrientation) const
 
bool rotateExifQImage (QImage &image, ImageOrientation orientation) const
 
bool setExifThumbnail (const QImage &thumb, bool setProgramName=true) const
 
bool removeExifThumbnail () const
 
bool setTiffThumbnail (const QImage &thumb, bool setProgramName=true) const
 
QString getExifComment () const
 
bool setExifComment (const QString &comment, bool setProgramName=true) const
 
QString getExifTagString (const char *exifTagName, bool escapeCR=true) const
 
bool setExifTagString (const char *exifTagName, const QString &value, bool setProgramName=true) const
 
bool getExifTagLong (const char *exifTagName, long &val) const
 
bool getExifTagLong (const char *exifTagName, long &val, int component) const
 
bool setExifTagLong (const char *exifTagName, long val, bool setProgramName=true) const
 
bool getExifTagRational (const char *exifTagName, long int &num, long int &den, int component=0) const
 
bool setExifTagRational (const char *exifTagName, long int num, long int den, bool setProgramName=true) const
 
QByteArray getExifTagData (const char *exifTagName) const
 
bool setExifTagData (const char *exifTagName, const QByteArray &data, bool setProgramName=true) const
 
QVariant getExifTagVariant (const char *exifTagName, bool rationalAsListOfInts=true, bool escapeCR=true, int component=0) const
 
bool setExifTagVariant (const char *exifTagName, const QVariant &data, bool rationalWantSmallDenominator=true, bool setProgramName=true) const
 
bool removeExifTag (const char *exifTagName, bool setProgramName=true) const
 
QString getExifTagTitle (const char *exifTagName)
 
QString getExifTagDescription (const char *exifTagName)
 
QString createExifUserStringFromValue (const char *exifTagName, const QVariant &val, bool escapeCR=true)
 
KExiv2::MetaDataMap getExifTagsDataList (const QStringList &exifKeysFilter=QStringList(), bool invertSelection=false) const
 
static bool canWriteExif (const QString &filePath)
 

IPTC manipulation methods

KExiv2::TagsMap getIptcTagsList () const
 
bool hasIptc () const
 
bool clearIptc () const
 
QByteArray getIptc (bool addIrbHeader=false) const
 
bool setIptc (const QByteArray &data) const
 
QString getIptcTagString (const char *iptcTagName, bool escapeCR=true) const
 
bool setIptcTagString (const char *iptcTagName, const QString &value, bool setProgramName=true) const
 
QStringList getIptcTagsStringList (const char *iptcTagName, bool escapeCR=true) const
 
bool setIptcTagsStringList (const char *iptcTagName, int maxSize, const QStringList &oldValues, const QStringList &newValues, bool setProgramName=true) const
 
QByteArray getIptcTagData (const char *iptcTagName) const
 
bool setIptcTagData (const char *iptcTagName, const QByteArray &data, bool setProgramName=true) const
 
bool removeIptcTag (const char *iptcTagName, bool setProgramName=true) const
 
QString getIptcTagTitle (const char *iptcTagName)
 
QString getIptcTagDescription (const char *iptcTagName)
 
KExiv2::MetaDataMap getIptcTagsDataList (const QStringList &iptcKeysFilter=QStringList(), bool invertSelection=false) const
 
QStringList getIptcKeywords () const
 
bool setIptcKeywords (const QStringList &oldKeywords, const QStringList &newKeywords, bool setProgramName=true) const
 
QStringList getIptcSubjects () const
 
bool setIptcSubjects (const QStringList &oldSubjects, const QStringList &newSubjects, bool setProgramName=true) const
 
QStringList getIptcSubCategories () const
 
bool setIptcSubCategories (const QStringList &oldSubCategories, const QStringList &newSubCategories, bool setProgramName=true) const
 
static bool canWriteIptc (const QString &filePath)
 

XMP manipulation methods

KExiv2::TagsMap getXmpTagsList () const
 
bool hasXmp () const
 
bool clearXmp () const
 
QByteArray getXmp () const
 
bool setXmp (const QByteArray &data) const
 
QString getXmpTagString (const char *xmpTagName, bool escapeCR=true) const
 
bool setXmpTagString (const char *xmpTagName, const QString &value, bool setProgramName=true) const
 
bool setXmpTagString (const char *xmpTagName, const QString &value, XmpTagType type, bool setProgramName=true) const
 
QString getXmpTagTitle (const char *xmpTagName)
 
QString getXmpTagDescription (const char *xmpTagName)
 
KExiv2::MetaDataMap getXmpTagsDataList (const QStringList &xmpKeysFilter=QStringList(), bool invertSelection=false) const
 
KExiv2::AltLangMap getXmpTagStringListLangAlt (const char *xmpTagName, bool escapeCR=true) const
 
bool setXmpTagStringListLangAlt (const char *xmpTagName, const KExiv2::AltLangMap &values, bool setProgramName) const
 
QString getXmpTagStringLangAlt (const char *xmpTagName, const QString &langAlt, bool escapeCR) const
 
bool setXmpTagStringLangAlt (const char *xmpTagName, const QString &value, const QString &langAlt, bool setProgramName=true) const
 
QStringList getXmpTagStringSeq (const char *xmpTagName, bool escapeCR=true) const
 
bool setXmpTagStringSeq (const char *xmpTagName, const QStringList &seq, bool setProgramName=true) const
 
QStringList getXmpTagStringBag (const char *xmpTagName, bool escapeCR) const
 
bool setXmpTagStringBag (const char *xmpTagName, const QStringList &bag, bool setProgramName=true) const
 
bool addToXmpTagStringBag (const char *xmpTagName, const QStringList &entriesToAdd, bool setProgramName) const
 
bool removeFromXmpTagStringBag (const char *xmpTagName, const QStringList &entriesToRemove, bool setProgramName) const
 
QVariant getXmpTagVariant (const char *xmpTagName, bool rationalAsListOfInts=true, bool stringEscapeCR=true) const
 
QStringList getXmpKeywords () const
 
bool setXmpKeywords (const QStringList &newKeywords, bool setProgramName=true) const
 
bool removeXmpKeywords (const QStringList &keywordsToRemove, bool setProgramName=true)
 
QStringList getXmpSubjects () const
 
bool setXmpSubjects (const QStringList &newSubjects, bool setProgramName=true) const
 
bool removeXmpSubjects (const QStringList &subjectsToRemove, bool setProgramName=true)
 
QStringList getXmpSubCategories () const
 
bool setXmpSubCategories (const QStringList &newSubCategories, bool setProgramName=true) const
 
bool removeXmpSubCategories (const QStringList &categoriesToRemove, bool setProgramName=true)
 
bool removeXmpTag (const char *xmpTagName, bool setProgramName=true) const
 
static bool canWriteXmp (const QString &filePath)
 
static bool registerXmpNameSpace (const QString &uri, const QString &prefix)
 
static bool unregisterXmpNameSpace (const QString &uri)
 

Detailed Description

KExiv2.

Definition at line 50 of file kexiv2.h.

Member Typedef Documentation

◆ AltLangMap

A map used to store a list of Alternative Language values.

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

Definition at line 118 of file kexiv2.h.

◆ MetaDataMap

A map used to store Tags Key and Tags Value.

Definition at line 112 of file kexiv2.h.

◆ TagsMap

A map used to store Tags Key and a list of Tags properties :

  • name,
  • title,
  • description.

Definition at line 125 of file kexiv2.h.

Member Enumeration Documentation

◆ ImageColorWorkSpace

The image color workspace values given by Exif metadata.

Definition at line 75 of file kexiv2.h.

◆ ImageOrientation

The image orientation values given by Exif metadata.

Definition at line 85 of file kexiv2.h.

◆ MetadataWritingMode

The image metadata writing mode, between image file metadata and XMP sidecar file, depending on the context.

See also
MetadataWritingMode(), metadataWritingMode()
Enumerator
WRITETOIMAGEONLY 

Write metadata to image file only.

WRITETOSIDECARONLY 

Write metadata to sidecar file only.

WRITETOSIDECARANDIMAGE 

Write metadata to image and sidecar files.

WRITETOSIDECARONLY4READONLYFILES 

Write metadata to sidecar file only for read only images such as RAW files for example.

Definition at line 58 of file kexiv2.h.

◆ XmpTagType

Xmp tag types, used by setXmpTag, only first three types are used.

Definition at line 101 of file kexiv2.h.

Constructor & Destructor Documentation

◆ KExiv2() [1/4]

KExiv2Iface::KExiv2::KExiv2 ( )

Standard constructor.

Definition at line 19 of file kexiv2.cpp.

◆ KExiv2() [2/4]

KExiv2Iface::KExiv2::KExiv2 ( const KExiv2 & metadata)

Copy constructor.

Definition at line 24 of file kexiv2.cpp.

◆ KExiv2() [3/4]

KExiv2Iface::KExiv2::KExiv2 ( const KExiv2Data & data)

Constructor to load from parsed data.

Definition at line 30 of file kexiv2.cpp.

◆ KExiv2() [4/4]

KExiv2Iface::KExiv2::KExiv2 ( const QString & filePath)

Contructor to Load Metadata from image file.

Definition at line 36 of file kexiv2.cpp.

◆ ~KExiv2()

KExiv2Iface::KExiv2::~KExiv2 ( )
virtualdefault

Standard destructor.

Member Function Documentation

◆ addToXmpTagStringBag()

bool KExiv2Iface::KExiv2::addToXmpTagStringBag ( const char * xmpTagName,
const QStringList & entriesToAdd,
bool setProgramName ) const

Set an Xmp tag content using a list of strings defined by the 'entriesToAdd' parameter.

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

Definition at line 900 of file kexiv2xmp.cpp.

◆ applyChanges()

bool KExiv2Iface::KExiv2::applyChanges ( ) const

The same than save() method, but it apply on current image.

Return true if metadata have been saved into file.

Definition at line 447 of file kexiv2.cpp.

◆ canWriteComment()

bool KExiv2Iface::KExiv2::canWriteComment ( const QString & filePath)
static

Return 'true' if Comments can be written in file.

Definition at line 17 of file kexiv2comments.cpp.

◆ canWriteExif()

bool KExiv2Iface::KExiv2::canWriteExif ( const QString & filePath)
static

Return 'true' if Exif can be written in file.

Definition at line 27 of file kexiv2exif.cpp.

◆ canWriteIptc()

bool KExiv2Iface::KExiv2::canWriteIptc ( const QString & filePath)
static

Return 'true' if Iptc can be written in file.

Definition at line 17 of file kexiv2iptc.cpp.

◆ canWriteXmp()

bool KExiv2Iface::KExiv2::canWriteXmp ( const QString & filePath)
static

Return 'true' if Xmp can be written in file.

Definition at line 17 of file kexiv2xmp.cpp.

◆ cleanupExiv2()

bool KExiv2Iface::KExiv2::cleanupExiv2 ( )
static

Return true if Exiv2 library memory allocations are cleaned properly.

This method must be called after using libkexiv2 with multithreading. It cleans up memory used by Adobe XMP SDK See B.K.O #166424 for details.

Definition at line 75 of file kexiv2.cpp.

◆ clearComments()

bool KExiv2Iface::KExiv2::clearComments ( ) const

Clear the Comments metadata container in memory.

Definition at line 56 of file kexiv2comments.cpp.

◆ clearExif()

bool KExiv2Iface::KExiv2::clearExif ( ) const

Clear the Exif metadata container in memory.

Definition at line 67 of file kexiv2exif.cpp.

◆ clearIptc()

bool KExiv2Iface::KExiv2::clearIptc ( ) const

Clear the Iptc metadata container in memory.

Definition at line 56 of file kexiv2iptc.cpp.

◆ clearXmp()

bool KExiv2Iface::KExiv2::clearXmp ( ) const

Clear the Xmp metadata container in memory.

Definition at line 71 of file kexiv2xmp.cpp.

◆ convertFromGPSCoordinateString() [1/2]

bool KExiv2Iface::KExiv2::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

Converts a GPSCoordinate string as defined by XMP to three rationals and the direction reference.

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.

Definition at line 824 of file kexiv2gps.cpp.

◆ convertFromGPSCoordinateString() [2/2]

bool KExiv2Iface::KExiv2::convertFromGPSCoordinateString ( const QString & gpsString,
double *const coordinate )
static

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 -).

Returns true if the conversion was successful.

Definition at line 873 of file kexiv2gps.cpp.

◆ convertToGPSCoordinateString() [1/2]

QString KExiv2Iface::KExiv2::convertToGPSCoordinateString ( const bool isLatitude,
double coordinate )
static

Converts a GPS position stored as double floating point number in degrees to the form described as GPSCoordinate in the XMP specification.

Definition at line 783 of file kexiv2gps.cpp.

◆ convertToGPSCoordinateString() [2/2]

QString KExiv2Iface::KExiv2::convertToGPSCoordinateString ( const long int numeratorDegrees,
const long int denominatorDegrees,
const long int numeratorMinutes,
const long int denominatorMinutes,
const long int numeratorSeconds,
long int denominatorSeconds,
const char directionReference )
static

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".

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)

Definition at line 710 of file kexiv2gps.cpp.

◆ convertToRational()

void KExiv2Iface::KExiv2::convertToRational ( const double number,
long int *const numerator,
long int *const denominator,
const int rounding )
static

This method converts 'number' to a rational value, returned in the 'numerator' and 'denominator' parameters.

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.

Definition at line 583 of file kexiv2gps.cpp.

◆ convertToRationalSmallDenominator()

void KExiv2Iface::KExiv2::convertToRationalSmallDenominator ( const double number,
long int *const numerator,
long int *const denominator )
static

This method convert a 'number' to a rational value, returned in 'numerator' and 'denominator' parameters.

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.

Definition at line 643 of file kexiv2gps.cpp.

◆ convertToUserPresentableNumbers() [1/2]

void KExiv2Iface::KExiv2::convertToUserPresentableNumbers ( const bool isLatitude,
double coordinate,
int *const degrees,
int *const minutes,
double *const seconds,
char *const directionReference )
static

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').

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

Definition at line 948 of file kexiv2gps.cpp.

◆ convertToUserPresentableNumbers() [2/2]

bool KExiv2Iface::KExiv2::convertToUserPresentableNumbers ( const QString & coordinate,
int *const degrees,
int *const minutes,
double *const seconds,
char *const directionReference )
static

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')

Definition at line 912 of file kexiv2gps.cpp.

◆ createExifUserStringFromValue()

QString KExiv2Iface::KExiv2::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).

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

Definition at line 575 of file kexiv2exif.cpp.

◆ data()

KExiv2Data KExiv2Iface::KExiv2::data ( ) const

Definition at line 182 of file kexiv2.cpp.

◆ detectLanguageAlt()

QString KExiv2Iface::KExiv2::detectLanguageAlt ( const QString & value,
QString & lang )
static

Language Alternative autodetection.

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.

Definition at line 77 of file kexiv2comments.cpp.

◆ Exiv2Version()

QString KExiv2Iface::KExiv2::Exiv2Version ( )
static

Return a string version of Exiv2 release in format "major.minor.patch".

Definition at line 132 of file kexiv2.cpp.

◆ getComments()

QByteArray KExiv2Iface::KExiv2::getComments ( ) const

Return a Qt byte array copy of Comments container get from current image.

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.

Definition at line 61 of file kexiv2comments.cpp.

◆ getCommentsDecoded()

QString KExiv2Iface::KExiv2::getCommentsDecoded ( ) const

Return a Qt string object of Comments from current image decoded using the 'detectEncodingAndDecode()' method.

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

Definition at line 66 of file kexiv2comments.cpp.

◆ getDigitizationDateTime()

QDateTime KExiv2Iface::KExiv2::getDigitizationDateTime ( bool fallbackToCreationTime = false) const

Return the digitization time stamp of the image.

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

Definition at line 939 of file kexiv2image.cpp.

◆ getExifComment()

QString KExiv2Iface::KExiv2::getExifComment ( ) const

Return a QString copy of Exif user comments.

Return a null string if user comments cannot be found.

Definition at line 226 of file kexiv2exif.cpp.

◆ getExifEncoded()

QByteArray KExiv2Iface::KExiv2::getExifEncoded ( bool addExifHeader = false) const

Returns the exif data encoded to a QByteArray in a form suitable for storage in a JPEG image.

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.

Definition at line 86 of file kexiv2exif.cpp.

◆ getExifTagData()

QByteArray KExiv2Iface::KExiv2::getExifTagData ( const char * exifTagName) const

Get an Exif tag content like a bytes array.

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

Definition at line 699 of file kexiv2exif.cpp.

◆ getExifTagDescription()

QString KExiv2Iface::KExiv2::getExifTagDescription ( const char * exifTagName)

Return the Exif Tag description or a null string.

Definition at line 347 of file kexiv2exif.cpp.

◆ getExifTagLong() [1/2]

bool KExiv2Iface::KExiv2::getExifTagLong ( const char * exifTagName,
long & val ) const

Get an Exif tag content like a long value.

Return true if Exif tag be found.

Definition at line 664 of file kexiv2exif.cpp.

◆ getExifTagLong() [2/2]

bool KExiv2Iface::KExiv2::getExifTagLong ( const char * exifTagName,
long & val,
int component ) const

Get an Exif tag content like a long value.

Return true if Exif tag be found.

Definition at line 669 of file kexiv2exif.cpp.

◆ getExifTagRational()

bool KExiv2Iface::KExiv2::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.

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

Definition at line 396 of file kexiv2exif.cpp.

◆ getExifTagsDataList()

KExiv2::MetaDataMap KExiv2Iface::KExiv2::getExifTagsDataList ( const QStringList & exifKeysFilter = QStringList(),
bool invertSelection = false ) const

Return a map of Exif tags name/value found in metadata sorted by Exif keys given by 'exifKeysFilter'.

'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 witch :

  • 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.

Definition at line 152 of file kexiv2exif.cpp.

◆ getExifTagString()

QString KExiv2Iface::KExiv2::getExifTagString ( const char * exifTagName,
bool escapeCR = true ) const

Get an Exif tags content like a string.

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

Definition at line 834 of file kexiv2exif.cpp.

◆ getExifTagTitle()

QString KExiv2Iface::KExiv2::getExifTagTitle ( const char * exifTagName)

Return the Exif Tag title or a null string.

Definition at line 326 of file kexiv2exif.cpp.

◆ getExifTagVariant()

QVariant KExiv2Iface::KExiv2::getExifTagVariant ( const char * exifTagName,
bool rationalAsListOfInts = true,
bool escapeCR = true,
int component = 0 ) const

Get an Exif tags content as a QVariant.

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.

Definition at line 729 of file kexiv2exif.cpp.

◆ getExifThumbnail()

QImage KExiv2Iface::KExiv2::getExifThumbnail ( bool fixOrientation) const

Return a QImage copy of Exif thumbnail image.

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.

Definition at line 888 of file kexiv2exif.cpp.

◆ getFilePath()

QString KExiv2Iface::KExiv2::getFilePath ( ) const

Return the file path of current image.

Definition at line 471 of file kexiv2.cpp.

◆ getGPSAltitude()

bool KExiv2Iface::KExiv2::getGPSAltitude ( double *const altitude) const

Get GPS altitude information, in meters, relative to sea level (positive sign above sea level)

Definition at line 222 of file kexiv2gps.cpp.

◆ getGPSInfo()

bool KExiv2Iface::KExiv2::getGPSInfo ( double & altitude,
double & latitude,
double & longitude ) const

Get all GPS location information set in image.

Return true if all information can be found.

Definition at line 28 of file kexiv2gps.cpp.

◆ getGPSLatitudeNumber()

bool KExiv2Iface::KExiv2::getGPSLatitudeNumber ( double *const latitude) const

Get GPS location information set in the image, as a double floating point number as in degrees where the sign determines the direction ref (North + / South - ; East + / West -).

Returns true if the information is available.

Definition at line 43 of file kexiv2gps.cpp.

◆ getGPSLatitudeString()

QString KExiv2Iface::KExiv2::getGPSLatitudeString ( ) const

Get GPS location information set in the image, in the GPSCoordinate format as described in the XMP specification.

Returns a null string in the information cannot be found.

Definition at line 296 of file kexiv2gps.cpp.

◆ getGPSLongitudeNumber()

bool KExiv2Iface::KExiv2::getGPSLongitudeNumber ( double *const longitude) const
Todo
Decoding of latitude and longitude works in the same way, code here can be put in a separate function

Definition at line 126 of file kexiv2gps.cpp.

◆ getGPSLongitudeString()

QString KExiv2Iface::KExiv2::getGPSLongitudeString ( ) const

Definition at line 306 of file kexiv2gps.cpp.

◆ getImageColorWorkSpace()

KExiv2::ImageColorWorkSpace KExiv2Iface::KExiv2::getImageColorWorkSpace ( ) const

Return the image color-space set in Exif metadata.

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

Definition at line 435 of file kexiv2image.cpp.

◆ getImageDateTime()

QDateTime KExiv2Iface::KExiv2::getImageDateTime ( ) const

Return the time stamp of image.

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

Definition at line 548 of file kexiv2image.cpp.

◆ getImageDimensions()

QSize KExiv2Iface::KExiv2::getImageDimensions ( ) const

Return the size of image in pixels using Exif tags.

Return a null dimmension if size cannot be found.

Definition at line 84 of file kexiv2image.cpp.

◆ getImageOrientation()

KExiv2::ImageOrientation KExiv2Iface::KExiv2::getImageOrientation ( ) const

Return the image orientation set in Exif metadata.

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

Definition at line 241 of file kexiv2image.cpp.

◆ getImagePreview()

bool KExiv2Iface::KExiv2::getImagePreview ( QImage & preview) const

Return a QImage copy of Iptc preview image.

Return a null image if preview cannot be found.

Definition at line 1055 of file kexiv2image.cpp.

◆ getIptc()

QByteArray KExiv2Iface::KExiv2::getIptc ( bool addIrbHeader = false) const

Return a Qt byte array copy of Iptc container get from current image.

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.

Definition at line 75 of file kexiv2iptc.cpp.

◆ getIptcKeywords()

QStringList KExiv2Iface::KExiv2::getIptcKeywords ( ) const

Return a strings list of Iptc keywords from image.

Return an empty list if no keyword are set.

Definition at line 555 of file kexiv2iptc.cpp.

◆ getIptcSubCategories()

QStringList KExiv2Iface::KExiv2::getIptcSubCategories ( ) const

Return a strings list of Iptc sub-categories from image.

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

Definition at line 758 of file kexiv2iptc.cpp.

◆ getIptcSubjects()

QStringList KExiv2Iface::KExiv2::getIptcSubjects ( ) const

Return a strings list of Iptc subjects from image.

Return an empty list if no subject are set.

Definition at line 660 of file kexiv2iptc.cpp.

◆ getIptcTagData()

QByteArray KExiv2Iface::KExiv2::getIptcTagData ( const char * iptcTagName) const

Get an Iptc tag content as a bytes array.

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

Definition at line 360 of file kexiv2iptc.cpp.

◆ getIptcTagDescription()

QString KExiv2Iface::KExiv2::getIptcTagDescription ( const char * iptcTagName)

Return the Iptc Tag description or a null string.

Definition at line 274 of file kexiv2iptc.cpp.

◆ getIptcTagsDataList()

KExiv2::MetaDataMap KExiv2Iface::KExiv2::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'.

'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 witch :

  • 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.

Definition at line 146 of file kexiv2iptc.cpp.

◆ getIptcTagsList()

KExiv2::TagsMap KExiv2Iface::KExiv2::getIptcTagsList ( ) const

Return a map of all standard Iptc tags supported by Exiv2.

Definition at line 857 of file kexiv2iptc.cpp.

◆ getIptcTagsStringList()

QStringList KExiv2Iface::KExiv2::getIptcTagsStringList ( const char * iptcTagName,
bool escapeCR = true ) const

Returns a strings list with of multiple Iptc tags from the image.

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.

Definition at line 446 of file kexiv2iptc.cpp.

◆ getIptcTagString()

QString KExiv2Iface::KExiv2::getIptcTagString ( const char * iptcTagName,
bool escapeCR = true ) const

Get an Iptc tag content like a string.

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

Definition at line 389 of file kexiv2iptc.cpp.

◆ getIptcTagTitle()

QString KExiv2Iface::KExiv2::getIptcTagTitle ( const char * iptcTagName)

Return the Iptc Tag title or a null string.

Definition at line 254 of file kexiv2iptc.cpp.

◆ getMakernoteTagsList()

KExiv2::TagsMap KExiv2Iface::KExiv2::getMakernoteTagsList ( ) const

Return a map of all non-standard Exif tags (makernotes) supported by Exiv2.

Definition at line 1139 of file kexiv2exif.cpp.

◆ getMimeType()

QString KExiv2Iface::KExiv2::getMimeType ( ) const

Returns the mime type of this image.

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

Definition at line 481 of file kexiv2.cpp.

◆ getPixelSize()

QSize KExiv2Iface::KExiv2::getPixelSize ( ) const

Returns the pixel size of the current image.

This information is read from the file, not from the metadata. The returned QSize is valid if the KExiv2 object was constructed by reading a file or image data; the information is not available when the object was created from KExiv2Data. Note that in the Exif or XMP metadata, there may be fields describing the image 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.

Definition at line 476 of file kexiv2.cpp.

◆ getStdExifTagsList()

KExiv2::TagsMap KExiv2Iface::KExiv2::getStdExifTagsList ( ) const

Return a map of all standard Exif tags supported by Exiv2.

Definition at line 1087 of file kexiv2exif.cpp.

◆ getXmp()

QByteArray KExiv2Iface::KExiv2::getXmp ( ) const

Return a Qt byte array copy of XMp container get from current image.

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

Definition at line 94 of file kexiv2xmp.cpp.

◆ getXmpKeywords()

QStringList KExiv2Iface::KExiv2::getXmpKeywords ( ) const

Return a strings list of Xmp keywords from image.

Return an empty list if no keyword are set.

Definition at line 1176 of file kexiv2xmp.cpp.

◆ getXmpSubCategories()

QStringList KExiv2Iface::KExiv2::getXmpSubCategories ( ) const

Return a strings list of Xmp sub-categories from image.

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

Definition at line 1191 of file kexiv2xmp.cpp.

◆ getXmpSubjects()

QStringList KExiv2Iface::KExiv2::getXmpSubjects ( ) const

Return a strings list of Xmp subjects from image.

Return an empty list if no subject are set.

Definition at line 1206 of file kexiv2xmp.cpp.

◆ getXmpTagDescription()

QString KExiv2Iface::KExiv2::getXmpTagDescription ( const char * xmpTagName)

Return the Xmp Tag description or a null string.

Definition at line 309 of file kexiv2xmp.cpp.

◆ getXmpTagsDataList()

KExiv2::MetaDataMap KExiv2Iface::KExiv2::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'.

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

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

List can be empty to not filter output.

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

  • 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.

Definition at line 164 of file kexiv2xmp.cpp.

◆ getXmpTagsList()

KExiv2::TagsMap KExiv2Iface::KExiv2::getXmpTagsList ( ) const

Return a map of all standard Xmp tags supported by Exiv2.

Definition at line 1221 of file kexiv2xmp.cpp.

◆ getXmpTagString()

QString KExiv2Iface::KExiv2::getXmpTagString ( const char * xmpTagName,
bool escapeCR = true ) const

Get a Xmp tag content like a string.

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

Definition at line 336 of file kexiv2xmp.cpp.

◆ getXmpTagStringBag()

QStringList KExiv2Iface::KExiv2::getXmpTagStringBag ( const char * xmpTagName,
bool escapeCR ) const

Get a Xmp tag content like a bag of strings.

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.

Definition at line 796 of file kexiv2xmp.cpp.

◆ getXmpTagStringLangAlt()

QString KExiv2Iface::KExiv2::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.

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

Definition at line 572 of file kexiv2xmp.cpp.

◆ getXmpTagStringListLangAlt()

KExiv2::AltLangMap KExiv2Iface::KExiv2::getXmpTagStringListLangAlt ( const char * xmpTagName,
bool escapeCR = true ) const

Get all redondant Alternative Language Xmp tags content like a map.

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.

Definition at line 467 of file kexiv2xmp.cpp.

◆ getXmpTagStringSeq()

QStringList KExiv2Iface::KExiv2::getXmpTagStringSeq ( const char * xmpTagName,
bool escapeCR = true ) const

Get a Xmp tag content like a sequence of strings.

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.

Definition at line 691 of file kexiv2xmp.cpp.

◆ getXmpTagTitle()

QString KExiv2Iface::KExiv2::getXmpTagTitle ( const char * xmpTagName)

Return the Xmp Tag title or a null string.

Definition at line 281 of file kexiv2xmp.cpp.

◆ getXmpTagVariant()

QVariant KExiv2Iface::KExiv2::getXmpTagVariant ( const char * xmpTagName,
bool rationalAsListOfInts = true,
bool stringEscapeCR = true ) const

Get an Xmp tag content as a QVariant.

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.

Definition at line 944 of file kexiv2xmp.cpp.

◆ hasComments()

bool KExiv2Iface::KExiv2::hasComments ( ) const

Return 'true' if metadata container in memory as Comments.

Definition at line 51 of file kexiv2comments.cpp.

◆ hasExif()

bool KExiv2Iface::KExiv2::hasExif ( ) const

Return 'true' if metadata container in memory as Exif.

Definition at line 62 of file kexiv2exif.cpp.

◆ hasIptc()

bool KExiv2Iface::KExiv2::hasIptc ( ) const

Return 'true' if metadata container in memory as Iptc.

Definition at line 51 of file kexiv2iptc.cpp.

◆ hasSidecar()

bool KExiv2Iface::KExiv2::hasSidecar ( const QString & path)
static

Performs a QFileInfo based check if the given local file has a sidecar.

Definition at line 175 of file kexiv2.cpp.

◆ hasXmp()

bool KExiv2Iface::KExiv2::hasXmp ( ) const

Return 'true' if metadata container in memory as Xmp.

Definition at line 58 of file kexiv2xmp.cpp.

◆ initializeExiv2()

bool KExiv2Iface::KExiv2::initializeExiv2 ( )
static

Return true if Exiv2 library initialization is done properly.

This method must be called before using libkexiv2 with multithreading. It initialize several non re-entrancy code from Adobe XMP SDK See B.K.O #166424 for details. Call cleanupExiv2() to clean things up later.

Definition at line 53 of file kexiv2.cpp.

◆ initializeGPSInfo()

bool KExiv2Iface::KExiv2::initializeGPSInfo ( const bool setProgramName)

Make sure all static required GPS EXIF and XMP tags exist.

Definition at line 316 of file kexiv2gps.cpp.

◆ isEmpty()

bool KExiv2Iface::KExiv2::isEmpty ( ) const

Return 'true' if metadata container in memory as no Comments, Exif, Iptc, and Xmp.

Definition at line 458 of file kexiv2.cpp.

◆ load()

bool KExiv2Iface::KExiv2::load ( const QString & filePath) const
virtual

Load all metadata (Exif, Iptc, Xmp, and JFIF Comments) from a picture (JPEG, RAW, TIFF, PNG, DNG, etc...).

Return true if metadata have been loaded successfully from file.

Definition at line 258 of file kexiv2.cpp.

◆ loadFromData()

bool KExiv2Iface::KExiv2::loadFromData ( const QByteArray & imgData) const

Load all metadata (Exif, Iptc, Xmp, and JFIF Comments) from a byte array.

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

Definition at line 203 of file kexiv2.cpp.

◆ metadataWritingMode()

int KExiv2Iface::KExiv2::metadataWritingMode ( ) const

Return the metadata writing mode.

Returns
Metadata writing mode as defined by the MetadataWritingMode enum.
See also
MetadataWritingMode, setMetadataWritingMode()

Definition at line 511 of file kexiv2.cpp.

◆ operator=()

KExiv2 & KExiv2Iface::KExiv2::operator= ( const KExiv2 & metadata)

Create a copy of container.

Definition at line 44 of file kexiv2.cpp.

◆ registerXmpNameSpace()

bool KExiv2Iface::KExiv2::registerXmpNameSpace ( const QString & uri,
const QString & prefix )
static

Register a namespace which Exiv2 doesn't know yet.

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. NOTE: If the Xmp metadata is read from an image, namespaces are decoded and registered by Exiv2 at the same time.

Definition at line 1074 of file kexiv2xmp.cpp.

◆ removeExifTag()

bool KExiv2Iface::KExiv2::removeExifTag ( const char * exifTagName,
bool setProgramName = true ) const

Remove the Exif tag 'exifTagName' from Exif metadata.

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

Definition at line 368 of file kexiv2exif.cpp.

◆ removeExifThumbnail()

bool KExiv2Iface::KExiv2::removeExifThumbnail ( ) const

Remove the Exif Thumbnail from the image.

Definition at line 1066 of file kexiv2exif.cpp.

◆ removeFromXmpTagStringBag()

bool KExiv2Iface::KExiv2::removeFromXmpTagStringBag ( const char * xmpTagName,
const QStringList & entriesToRemove,
bool setProgramName ) const

Remove those Xmp tag entries that are listed in entriesToRemove from the entries in metadata.

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

Definition at line 922 of file kexiv2xmp.cpp.

◆ removeGPSInfo()

bool KExiv2Iface::KExiv2::removeGPSInfo ( const bool setProgramName = true)

Remove all Exif tags relevant of GPS location information.

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

Definition at line 507 of file kexiv2gps.cpp.

◆ removeIptcTag()

bool KExiv2Iface::KExiv2::removeIptcTag ( const char * iptcTagName,
bool setProgramName = true ) const

Remove the all instance of Iptc tags 'iptcTagName' from Iptc metadata.

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

Definition at line 294 of file kexiv2iptc.cpp.

◆ removeXmpKeywords()

bool KExiv2Iface::KExiv2::removeXmpKeywords ( const QStringList & keywordsToRemove,
bool setProgramName = true )

Remove those Xmp keywords that are listed in keywordsToRemove from the keywords in metadata.

Return true if keywords are no longer contained in metadata.

Definition at line 1186 of file kexiv2xmp.cpp.

◆ removeXmpSubCategories()

bool KExiv2Iface::KExiv2::removeXmpSubCategories ( const QStringList & categoriesToRemove,
bool setProgramName = true )

Remove those Xmp sub-categories that are listed in categoriesToRemove from the sub-categories in metadata.

Return true if subjects are no longer contained in metadata.

Definition at line 1201 of file kexiv2xmp.cpp.

◆ removeXmpSubjects()

bool KExiv2Iface::KExiv2::removeXmpSubjects ( const QStringList & subjectsToRemove,
bool setProgramName = true )

Remove those Xmp subjects that are listed in subjectsToRemove from the subjects in metadata.

Return true if subjects are no longer contained in metadata.

Definition at line 1216 of file kexiv2xmp.cpp.

◆ removeXmpTag()

bool KExiv2Iface::KExiv2::removeXmpTag ( const char * xmpTagName,
bool setProgramName = true ) const

Remove the Xmp tag 'xmpTagName' from Xmp metadata.

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

Definition at line 1139 of file kexiv2xmp.cpp.

◆ rotateExifQImage()

bool KExiv2Iface::KExiv2::rotateExifQImage ( QImage & image,
ImageOrientation orientation ) const

Fix orientation of a QImage image accordingly with Exif orientation tag.

Return true if image is rotated, else false.

Definition at line 944 of file kexiv2exif.cpp.

◆ save()

bool KExiv2Iface::KExiv2::save ( const QString & filePath) const

Save all metadata to a file.

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

Definition at line 359 of file kexiv2.cpp.

◆ setComments()

bool KExiv2Iface::KExiv2::setComments ( const QByteArray & data) const

Set the Comments data using a Qt byte array.

Return true if Comments metadata have been changed in memory.

Definition at line 71 of file kexiv2comments.cpp.

◆ setData()

void KExiv2Iface::KExiv2::setData ( const KExiv2Data & data)

Definition at line 189 of file kexiv2.cpp.

◆ setExif()

bool KExiv2Iface::KExiv2::setExif ( const QByteArray & data) const

Set the Exif data using a Qt byte array.

Return true if Exif metadata have been changed in memory.

Definition at line 127 of file kexiv2exif.cpp.

◆ setExifComment()

bool KExiv2Iface::KExiv2::setExifComment ( const QString & comment,
bool setProgramName = true ) const

Set the Exif user comments from image.

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

Definition at line 283 of file kexiv2exif.cpp.

◆ setExifTagData()

bool KExiv2Iface::KExiv2::setExifTagData ( const char * exifTagName,
const QByteArray & data,
bool setProgramName = true ) const

Set an Exif tag content using a bytes array.

Return true if tag is set successfully.

Definition at line 468 of file kexiv2exif.cpp.

◆ setExifTagLong()

bool KExiv2Iface::KExiv2::setExifTagLong ( const char * exifTagName,
long val,
bool setProgramName = true ) const

Set an Exif tag content using a long value.

Return true if tag is set successfully.

Definition at line 424 of file kexiv2exif.cpp.

◆ setExifTagRational()

bool KExiv2Iface::KExiv2::setExifTagRational ( const char * exifTagName,
long int num,
long int den,
bool setProgramName = true ) const

Set an Exif tag content using a rational value.

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

Definition at line 446 of file kexiv2exif.cpp.

◆ setExifTagString()

bool KExiv2Iface::KExiv2::setExifTagString ( const char * exifTagName,
const QString & value,
bool setProgramName = true ) const

Set an Exif tag content using a string.

Return true if tag is set successfully.

Definition at line 866 of file kexiv2exif.cpp.

◆ setExifTagVariant()

bool KExiv2Iface::KExiv2::setExifTagVariant ( const char * exifTagName,
const QVariant & data,
bool rationalWantSmallDenominator = true,
bool setProgramName = true ) const

Set an Exif tag content using a QVariant.

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.

Definition at line 494 of file kexiv2exif.cpp.

◆ setExifThumbnail()

bool KExiv2Iface::KExiv2::setExifThumbnail ( const QImage & thumb,
bool setProgramName = true ) const

Set the Exif Thumbnail image.

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

Definition at line 957 of file kexiv2exif.cpp.

◆ setFilePath()

void KExiv2Iface::KExiv2::setFilePath ( const QString & path)

Set the file path of current image.

Definition at line 466 of file kexiv2.cpp.

◆ setGPSInfo() [1/3]

bool KExiv2Iface::KExiv2::setGPSInfo ( const double *const altitude,
const double latitude,
const double longitude,
const bool setProgramName = true )

Set all GPS location information into image.

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

Definition at line 363 of file kexiv2gps.cpp.

◆ setGPSInfo() [2/3]

bool KExiv2Iface::KExiv2::setGPSInfo ( const double altitude,
const double latitude,
const double longitude,
const bool setProgramName = true )

Set all GPS location information into image.

Return true if all information have been changed in metadata.

Definition at line 358 of file kexiv2gps.cpp.

◆ setGPSInfo() [3/3]

bool KExiv2Iface::KExiv2::setGPSInfo ( const double altitude,
const QString & latitude,
const QString & longitude,
const bool setProgramName = true )

Set all GPS location information into image.

Return true if all information have been changed in metadata.

Definition at line 494 of file kexiv2gps.cpp.

◆ setImageColorWorkSpace()

bool KExiv2Iface::KExiv2::setImageColorWorkSpace ( ImageColorWorkSpace workspace,
bool setProgramName = true ) const

Set the Exif color-space tag of image.

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

Definition at line 515 of file kexiv2image.cpp.

◆ setImageDateTime()

bool KExiv2Iface::KExiv2::setImageDateTime ( const QDateTime & dateTime,
bool setDateTimeDigitized = false,
bool setProgramName = true ) const

Set the Exif and Iptc time stamp.

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

Definition at line 854 of file kexiv2image.cpp.

◆ setImageDimensions()

bool KExiv2Iface::KExiv2::setImageDimensions ( const QSize & size,
bool setProgramName = true ) const

Set the size of image in pixels in Exif tags.

Return true if size have been changed in metadata.

Definition at line 201 of file kexiv2image.cpp.

◆ setImageOrientation()

bool KExiv2Iface::KExiv2::setImageOrientation ( ImageOrientation orientation,
bool setProgramName = true ) const

Set the Exif orientation tag of image.

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

Definition at line 354 of file kexiv2image.cpp.

◆ setImagePreview()

bool KExiv2Iface::KExiv2::setImagePreview ( const QImage & preview,
bool setProgramName = true ) const
virtual

Set the Iptc preview image.

The thumbnail image 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-implemente this method if you want to use another image file format than JPEG to save preview.

Definition at line 1077 of file kexiv2image.cpp.

◆ setImageProgramId()

bool KExiv2Iface::KExiv2::setImageProgramId ( const QString & program,
const QString & version ) const

Set Program name and program version in Exif and Iptc Metadata.

Return true if information have been changed in metadata.

Definition at line 23 of file kexiv2image.cpp.

◆ setIptc()

bool KExiv2Iface::KExiv2::setIptc ( const QByteArray & data) const

Set the Iptc data using a Qt byte array.

Return true if Iptc metadata have been changed in memory.

Definition at line 119 of file kexiv2iptc.cpp.

◆ setIptcKeywords()

bool KExiv2Iface::KExiv2::setIptcKeywords ( const QStringList & oldKeywords,
const QStringList & newKeywords,
bool setProgramName = true ) const

Set Iptc keywords using a list of strings defined by 'newKeywords' parameter.

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

Definition at line 592 of file kexiv2iptc.cpp.

◆ setIptcSubCategories()

bool KExiv2Iface::KExiv2::setIptcSubCategories ( const QStringList & oldSubCategories,
const QStringList & newSubCategories,
bool setProgramName = true ) const

Set Iptc sub-categories using a list of strings defined by 'newSubCategories' parameter.

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

Definition at line 793 of file kexiv2iptc.cpp.

◆ setIptcSubjects()

bool KExiv2Iface::KExiv2::setIptcSubjects ( const QStringList & oldSubjects,
const QStringList & newSubjects,
bool setProgramName = true ) const

Set Iptc subjects using a list of strings defined by 'newSubjects' parameter.

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

Definition at line 695 of file kexiv2iptc.cpp.

◆ setIptcTagData()

bool KExiv2Iface::KExiv2::setIptcTagData ( const char * iptcTagName,
const QByteArray & data,
bool setProgramName = true ) const

Set an Iptc tag content using a bytes array.

Return true if tag is set successfully.

Definition at line 334 of file kexiv2iptc.cpp.

◆ setIptcTagsStringList()

bool KExiv2Iface::KExiv2::setIptcTagsStringList ( const char * iptcTagName,
int maxSize,
const QStringList & oldValues,
const QStringList & newValues,
bool setProgramName = true ) const

Set multiple Iptc tags contents using a strings list.

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

Definition at line 485 of file kexiv2iptc.cpp.

◆ setIptcTagString()

bool KExiv2Iface::KExiv2::setIptcTagString ( const char * iptcTagName,
const QString & value,
bool setProgramName = true ) const

Set an Iptc tag content using a string.

Return true if tag is set successfully.

Definition at line 421 of file kexiv2iptc.cpp.

◆ setMetadataWritingMode()

void KExiv2Iface::KExiv2::setMetadataWritingMode ( const int mode)

Set metadata writing mode.

Parameters
modeMetadata writing mode as defined by the MetadataWritingMode enum.
See also
MetadataWritingMode, metadataWritingMode()

Definition at line 506 of file kexiv2.cpp.

◆ setProgramId()

bool KExiv2Iface::KExiv2::setProgramId ( bool on = true) const
protectedvirtual

Re-implement this method to set automatically the Program Name and Program Version information in Exif and Iptc metadata if 'on' argument is true.

This method is called by all methods which change tags in metadata. By default this method does nothing and returns true.

Definition at line 526 of file kexiv2.cpp.

◆ setTiffThumbnail()

bool KExiv2Iface::KExiv2::setTiffThumbnail ( const QImage & thumb,
bool setProgramName = true ) const

Adds a JPEG thumbnail to a TIFF images.

Use this instead of setExifThumbnail for TIFF images.

Definition at line 989 of file kexiv2exif.cpp.

◆ setUpdateFileTimeStamp()

void KExiv2Iface::KExiv2::setUpdateFileTimeStamp ( bool on)

Enable or disable file timestamp updating when metadata are saved.

By default files timestamp are untouched.

Definition at line 516 of file kexiv2.cpp.

◆ setUseXMPSidecar4Reading()

void KExiv2Iface::KExiv2::setUseXMPSidecar4Reading ( const bool on)

Enable or disable using XMP sidecar for reading metadata.

Definition at line 496 of file kexiv2.cpp.

◆ setWriteRawFiles()

void KExiv2Iface::KExiv2::setWriteRawFiles ( const bool on)

Enable or disable writing metadata operations to RAW tiff based files.

It requires Exiv2 0.18. By default RAW files are untouched.

Definition at line 486 of file kexiv2.cpp.

◆ setXmp()

bool KExiv2Iface::KExiv2::setXmp ( const QByteArray & data) const

Set the Xmp data using a Qt byte array.

Return true if Xmp metadata have been changed in memory.

Definition at line 126 of file kexiv2xmp.cpp.

◆ setXmpKeywords()

bool KExiv2Iface::KExiv2::setXmpKeywords ( const QStringList & newKeywords,
bool setProgramName = true ) const

Set Xmp keywords using a list of strings defined by 'newKeywords' parameter.

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

Definition at line 1181 of file kexiv2xmp.cpp.

◆ setXmpSubCategories()

bool KExiv2Iface::KExiv2::setXmpSubCategories ( const QStringList & newSubCategories,
bool setProgramName = true ) const

Set Xmp sub-categories using a list of strings defined by 'newSubCategories' parameter.

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

Definition at line 1196 of file kexiv2xmp.cpp.

◆ setXmpSubjects()

bool KExiv2Iface::KExiv2::setXmpSubjects ( const QStringList & newSubjects,
bool setProgramName = true ) const

Set Xmp subjects using a list of strings defined by 'newSubjects' parameter.

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

Definition at line 1211 of file kexiv2xmp.cpp.

◆ setXmpTagString() [1/2]

bool KExiv2Iface::KExiv2::setXmpTagString ( const char * xmpTagName,
const QString & value,
bool setProgramName = true ) const

Set a Xmp tag content using a string.

Return true if tag is set successfully.

Definition at line 377 of file kexiv2xmp.cpp.

◆ setXmpTagString() [2/2]

bool KExiv2Iface::KExiv2::setXmpTagString ( const char * xmpTagName,
const QString & value,
KExiv2::XmpTagType type,
bool setProgramName = true ) const

Set a Xmp tag with a specific type.

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

Definition at line 415 of file kexiv2xmp.cpp.

◆ setXmpTagStringBag()

bool KExiv2Iface::KExiv2::setXmpTagStringBag ( const char * xmpTagName,
const QStringList & bag,
bool setProgramName = true ) const

Set a Xmp tag content using the bag of strings 'bag'.

Return true if tag is set successfully.

Definition at line 847 of file kexiv2xmp.cpp.

◆ setXmpTagStringLangAlt()

bool KExiv2Iface::KExiv2::setXmpTagStringLangAlt ( const char * xmpTagName,
const QString & value,
const QString & langAlt,
bool setProgramName = true ) const

Set a Xmp tag content using a string with an alternative language header.

'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.

Definition at line 624 of file kexiv2xmp.cpp.

◆ setXmpTagStringListLangAlt()

bool KExiv2Iface::KExiv2::setXmpTagStringListLangAlt ( const char * xmpTagName,
const KExiv2::AltLangMap & values,
bool setProgramName ) const

Set an Alternative Language Xmp tag content using a map.

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

Definition at line 517 of file kexiv2xmp.cpp.

◆ setXmpTagStringSeq()

bool KExiv2Iface::KExiv2::setXmpTagStringSeq ( const char * xmpTagName,
const QStringList & seq,
bool setProgramName = true ) const

Set a Xmp tag content using the sequence of strings 'seq'.

Return true if tag is set successfully.

Definition at line 743 of file kexiv2xmp.cpp.

◆ sidecarFilePathForFile()

QString KExiv2Iface::KExiv2::sidecarFilePathForFile ( const QString & path)
static

Return the XMP Sidecar file path for a image file path.

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

Definition at line 145 of file kexiv2.cpp.

◆ sidecarPath()

QString KExiv2Iface::KExiv2::sidecarPath ( const QString & path)
static

Like sidecarFilePathForFile(), but works for local file path.

Definition at line 170 of file kexiv2.cpp.

◆ sidecarUrl() [1/2]

QUrl KExiv2Iface::KExiv2::sidecarUrl ( const QString & path)
static

Gives a file url for a local path.

Definition at line 165 of file kexiv2.cpp.

◆ sidecarUrl() [2/2]

QUrl KExiv2Iface::KExiv2::sidecarUrl ( const QUrl & url)
static

Like sidecarFilePathForFile(), but works for remote URLs.

Definition at line 157 of file kexiv2.cpp.

◆ supportMetadataWritting()

bool KExiv2Iface::KExiv2::supportMetadataWritting ( const QString & typeMime)
static

Return true if library can write metadata to typeMime file format.

Definition at line 102 of file kexiv2.cpp.

◆ supportXmp()

bool KExiv2Iface::KExiv2::supportXmp ( )
static

Return true if library can handle Xmp metadata.

Definition at line 93 of file kexiv2.cpp.

◆ unregisterXmpNameSpace()

bool KExiv2Iface::KExiv2::unregisterXmpNameSpace ( const QString & uri)
static

Unregister a previously registered custom namespace.

Definition at line 1107 of file kexiv2xmp.cpp.

◆ updateFileTimeStamp()

bool KExiv2Iface::KExiv2::updateFileTimeStamp ( ) const

Return true if file timestamp is updated when metadata are saved.

Definition at line 521 of file kexiv2.cpp.

◆ useXMPSidecar4Reading()

bool KExiv2Iface::KExiv2::useXMPSidecar4Reading ( ) const

Return true if using XMP sidecar for reading metadata is enabled.

Definition at line 501 of file kexiv2.cpp.

◆ version()

QString KExiv2Iface::KExiv2::version ( )
static

Return a string version of libkexiv2 release.

Definition at line 140 of file kexiv2.cpp.

◆ writeRawFiles()

bool KExiv2Iface::KExiv2::writeRawFiles ( ) const

Return true if writing metadata operations on RAW tiff based files is enabled.

It's require Exiv2 0.18.

Definition at line 491 of file kexiv2.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:12:07 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.