digiKam
Digikam::ExifToolParser Class Reference
+ Inheritance diagram for Digikam::ExifToolParser:

Classes

class  Private
 

Public Types

typedef QHash< QString, QVariantList > ExifToolData
 

Signals

void signalExifToolDataAvailable ()
 

Public Member Functions

bool applyChanges (const QString &path, const ExifToolData &newTags)
 
bool applyChanges (const QString &path, const QString &exvTempFile)
 
bool copyTags (const QString &src, const QString &dst, unsigned char copyOps, unsigned char writeModes=ExifToolProcess::ALL_MODES)
 
ExifToolData currentData () const
 
QString currentErrorString () const
 
QString currentPath () const
 
bool exifToolAvailable () const
 
 ExifToolParser (QObject *const parent)
 Constructor, Destructor, and Configuration Accessors. See exiftoolparser.cpp for details. More...
 
bool load (const QString &path, bool async=false)
 ExifTool Command Methods. See exiftoolparser_command.cpp for details. More...
 
bool loadChunk (const QString &path)
 
bool readableFormats ()
 
void setExifToolProgram (const QString &path)
 
void setOutputStream (int cmdAction, const QByteArray &cmdOutputChannel, const QByteArray &cmdErrorChannel)
 
bool tagsDatabase ()
 
bool translateTags (const QString &path, unsigned char transOps)
 
bool translationsList ()
 
bool version ()
 
bool writableFormats ()
 
 ~ExifToolParser ()
 

Static Public Member Functions

static MetaEngine::TagsMap tagsDbToOrderedMap (const ExifToolData &tagsDb)
 

Member Typedef Documentation

◆ ExifToolData

typedef QHash<QString, QVariantList> Digikam::ExifToolParser::ExifToolData

A map used to store ExifTool data shared with ExifToolProcess class:

With load() method, the container is used to get a map of ExifTool tag name as key and tags properties as values: key = ExifTool Tag name (QString - ExifTool Group 0.1.2.4.6) See -G Exiftool option (https://exiftool.org/exiftool_pod.html#Input-output-text-formatting). values = ExifTool Tag value (QString). ExifTool Tag type (QString). ExifTool Tag description (QString). ExifTool Tag numerical value (QString) - available if any .

With loadChunk() method, the container is used to get a EXV chunk as value: key = "EXV" (QString). value = the Exiv2 metadata container (QByteArray).

With applyChanges() method, the container is used as argument to store tupple of ExifTool tag name as key and tag value: key = ExifTool tag name (QString). value = ExifTool Tag value (QString).

With readableFormats() method, the container is used to get a list of upper-case file format extensions supported by ExifTool for reading. key = "READ_FORMAT" (QString). value = list of pairs (ext,desc) (QStringList)

With writableFormats() method, the container is used to get a list of upper-case file format extensions supported by ExifTool for writing. key = "WRITE_FORMAT" (QString). value = list of pairs (ext,desc) (QStringList).

With translationsList() method, the container is used to get a list of ExifTool languages available for translations. key = "TRANSLATIONS_LIST" (QString). value = list of languages as strings (aka fr, en, de, es, etc.) (QStringList).

With tagsDatabase() method, the container is used as argument to store tupple of ExifTool tag name as key and tag description: key = ExifTool tag name (QString). values = ExifTool Tag description (QString). ExifTool Tag type (QString). ExifTool Tag writable (QString).

Constructor & Destructor Documentation

◆ ExifToolParser()

◆ ~ExifToolParser()

Member Function Documentation

◆ applyChanges() [1/2]

bool Digikam::ExifToolParser::applyChanges ( const QString &  path,
const ExifToolData newTags 
)

Apply tag changes to a target file with ExifTool with a list of tag properties. Tags can already exists in target file or new ones can be created. To remove a tag, pass an empty string as value.

Parameters
pathis the target files to change.
newTagsis the list of tag properties.

References Digikam::ExifToolProcess::APPLY_CHANGES, Digikam::ExifToolParser::Private::currentPath, Digikam::ExifToolParser::Private::filePathEncoding(), Digikam::ExifToolParser::Private::prepareProcess(), and Digikam::ExifToolParser::Private::startProcess().

◆ applyChanges() [2/2]

bool Digikam::ExifToolParser::applyChanges ( const QString &  path,
const QString &  exvTempFile 
)

Apply tag changes to a target file with ExifTool with a EXV container. Tags can already exists in target file or new ones can be created.

Parameters
pathis the target files to change.
exvTempFileis the list of changes embedded in EXV constainer.

References Digikam::ExifToolProcess::APPLY_CHANGES_EXV, Digikam::ExifToolParser::Private::currentPath, Digikam::ExifToolParser::Private::filePathEncoding(), Digikam::ExifToolParser::Private::prepareProcess(), and Digikam::ExifToolParser::Private::startProcess().

◆ copyTags()

◆ currentData()

ExifToolParser::ExifToolData Digikam::ExifToolParser::currentData ( ) const

◆ currentErrorString()

QString Digikam::ExifToolParser::currentErrorString ( ) const

◆ currentPath()

◆ exifToolAvailable()

bool Digikam::ExifToolParser::exifToolAvailable ( ) const

◆ load()

bool Digikam::ExifToolParser::load ( const QString &  path,
bool  async = false 
)

◆ loadChunk()

bool Digikam::ExifToolParser::loadChunk ( const QString &  path)

◆ readableFormats()

bool Digikam::ExifToolParser::readableFormats ( )

◆ setExifToolProgram()

void Digikam::ExifToolParser::setExifToolProgram ( const QString &  path)

◆ setOutputStream()

void Digikam::ExifToolParser::setOutputStream ( int  cmdAction,
const QByteArray &  cmdOutputChannel,
const QByteArray &  cmdErrorChannel 
)

Unit-test method to check ExifTool stream parsing.

◆ signalExifToolDataAvailable

void Digikam::ExifToolParser::signalExifToolDataAvailable ( )
signal

◆ tagsDatabase()

bool Digikam::ExifToolParser::tagsDatabase ( )

Return a list of all tags from ExifTool database. Use currentData() to get the container. Warning: This method get whole ExifTool database in XML format and take age.

References Digikam::ExifToolParser::Private::currentPath, Digikam::ExifToolParser::Private::prepareProcess(), Digikam::ExifToolParser::Private::startProcess(), and Digikam::ExifToolProcess::TAGS_DATABASE.

◆ tagsDbToOrderedMap()

MetaEngine::TagsMap Digikam::ExifToolParser::tagsDbToOrderedMap ( const ExifToolData tagsDb)
static

Helper conversion method to translate unordered tags database hash-table to ordered map.

Tag are formatted like this:

EXIF.IFD0.Image.XResolution EXIF.IFD0.Image.YCbCrCoefficients EXIF.IFD0.Image.YCbCrPositioning EXIF.IFD0.Image.YCbCrSubSampling EXIF.IFD0.Image.YClipPathUnits EXIF.IFD0.Image.YPosition EXIF.IFD0.Image.YResolution FITS.FITS.Image.Author FITS.FITS.Image.Background FITS.FITS.Image.CreateDate FITS.FITS.Image.Instrument FITS.FITS.Image.Object FITS.FITS.Image.ObservationDate

◆ translateTags()

◆ translationsList()

bool Digikam::ExifToolParser::translationsList ( )

◆ version()

bool Digikam::ExifToolParser::version ( )

◆ writableFormats()

bool Digikam::ExifToolParser::writableFormats ( )

The documentation for this class was generated from the following files: