digiKam
|
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) |
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).
|
explicit |
Constructor, Destructor, and Configuration Accessors. See exiftoolparser.cpp for details.
References Digikam::ExifToolParser::Private::evLoops, Digikam::ExifToolParser::Private::hdls, Digikam::MetaEngineSettings::instance(), Digikam::ExifToolProcess::LOAD_METADATA, Digikam::ExifToolProcess::NO_ACTION, Digikam::ExifToolParser::Private::proc, Digikam::ExifToolProcess::signalCmdCompleted(), Digikam::ExifToolProcess::signalErrorOccurred(), and Digikam::ExifToolProcess::signalFinished().
Digikam::ExifToolParser::~ExifToolParser | ( | ) |
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.
path | is the target files to change. |
newTags | is 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().
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.
path | is the target files to change. |
exvTempFile | is 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().
bool Digikam::ExifToolParser::copyTags | ( | const QString & | src, |
const QString & | dst, | ||
unsigned char | copyOps, | ||
unsigned char | writeModes = ExifToolProcess::ALL_MODES |
||
) |
Copy group of tags from one source file to a destination file, following copy operations defined by 'copyOps'.
copyOps | is a OR combination of ExifToolProcess::CopyTagsSource values. |
transOps | is a OR combination of ExifToolProcess::TranslateTagsOps values. |
writeModes | is a OR combaniation of ExifToolProcess::WritingTagsMode values. |
dst | must be a writable file format supported by ExifTool. |
References Digikam::ExifToolProcess::COPY_ALL, Digikam::ExifToolProcess::COPY_EXIF, Digikam::ExifToolProcess::COPY_ICC, Digikam::ExifToolProcess::COPY_IPTC, Digikam::ExifToolProcess::COPY_MAKERNOTES, Digikam::ExifToolProcess::COPY_NONE, Digikam::ExifToolProcess::COPY_TAGS, Digikam::ExifToolProcess::COPY_XMP, Digikam::ExifToolProcess::CREATE_NEW_GROUPS, Digikam::ExifToolProcess::CREATE_NEW_TAGS, Digikam::ExifToolParser::Private::currentPath, Digikam::ExifToolParser::Private::filePathEncoding(), Digikam::ExifToolParser::Private::prepareProcess(), Digikam::ExifToolParser::Private::startProcess(), and Digikam::ExifToolProcess::WRITE_EXISTING_TAGS.
Referenced by Digikam::DNGWriter::Private::exifToolPostProcess().
ExifToolParser::ExifToolData Digikam::ExifToolParser::currentData | ( | ) | const |
References Digikam::ExifToolParser::Private::exifToolData.
Referenced by Digikam::LibsInfoDlg::LibsInfoDlg().
QString Digikam::ExifToolParser::currentErrorString | ( | ) | const |
QString Digikam::ExifToolParser::currentPath | ( | ) | const |
bool Digikam::ExifToolParser::exifToolAvailable | ( | ) | const |
Check the ExifTool program availability.
References Digikam::ExifToolProcess::checkExifToolProgram(), and Digikam::ExifToolParser::Private::proc.
Referenced by Digikam::DNGWriter::Private::exifToolPostProcess(), and Digikam::DNGSettings::slotSetupChanged().
bool Digikam::ExifToolParser::load | ( | const QString & | path, |
bool | async = false |
||
) |
ExifTool Command Methods. See exiftoolparser_command.cpp for details.
Load all metadata with ExifTool from a file. Use currentData() to get the ExifTool map.
References Digikam::ExifToolParser::Private::asyncLoading, Digikam::ExifToolParser::Private::currentPath, Digikam::ExifToolParser::Private::filePathEncoding(), Digikam::ExifToolProcess::LOAD_METADATA, Digikam::ExifToolParser::Private::prepareProcess(), and Digikam::ExifToolParser::Private::startProcess().
bool Digikam::ExifToolParser::loadChunk | ( | const QString & | path | ) |
Load Exif, Iptc, and Xmp chunk as Exiv2 EXV bytearray from a file. Use currentData() to get the container.
References Digikam::ExifToolParser::Private::currentPath, Digikam::ExifToolParser::Private::filePathEncoding(), Digikam::ExifToolProcess::LOAD_CHUNKS, Digikam::ExifToolParser::Private::prepareProcess(), and Digikam::ExifToolParser::Private::startProcess().
bool Digikam::ExifToolParser::readableFormats | ( | ) |
Return a list of readable file format extensions. Use currentData() to get the container as QStringList.
References Digikam::ExifToolParser::Private::currentPath, Digikam::ExifToolParser::Private::prepareProcess(), Digikam::ExifToolProcess::READ_FORMATS, and Digikam::ExifToolParser::Private::startProcess().
void Digikam::ExifToolParser::setExifToolProgram | ( | const QString & | path | ) |
void Digikam::ExifToolParser::setOutputStream | ( | int | cmdAction, |
const QByteArray & | cmdOutputChannel, | ||
const QByteArray & | cmdErrorChannel | ||
) |
Unit-test method to check ExifTool stream parsing.
|
signal |
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.
|
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
bool Digikam::ExifToolParser::translateTags | ( | const QString & | path, |
unsigned char | transOps | ||
) |
Translate group of tags in file.
transOps | is a OR combination of ExifToolProcess::TranslateTagsOps values. |
References Digikam::ExifToolParser::Private::argsFile, Digikam::ExifToolParser::Private::currentPath, Digikam::ExifToolParser::Private::filePathEncoding(), Digikam::ExifToolParser::Private::prepareProcess(), QT_ENDL, Digikam::ExifToolParser::Private::startProcess(), Digikam::ExifToolProcess::TRANS_ALL_EXIF, Digikam::ExifToolProcess::TRANS_ALL_IPTC, Digikam::ExifToolProcess::TRANS_ALL_XMP, and Digikam::ExifToolProcess::TRANS_TAGS.
Referenced by Digikam::DNGWriter::Private::exifToolPostProcess().
bool Digikam::ExifToolParser::translationsList | ( | ) |
Return a list of available translations. Use currentData() to get the container as QStringList.
References Digikam::ExifToolParser::Private::currentPath, Digikam::ExifToolParser::Private::prepareProcess(), Digikam::ExifToolParser::Private::startProcess(), and Digikam::ExifToolProcess::TRANSLATIONS_LIST.
bool Digikam::ExifToolParser::version | ( | ) |
Return the current version of ExifTool. Use currentData() to get the container as QString.
References Digikam::ExifToolParser::Private::currentPath, Digikam::ExifToolParser::Private::prepareProcess(), Digikam::ExifToolParser::Private::startProcess(), and Digikam::ExifToolProcess::VERSION_STRING.
Referenced by Digikam::LibsInfoDlg::LibsInfoDlg().
bool Digikam::ExifToolParser::writableFormats | ( | ) |
Return a list of writable file format extensions. Use currentData() to get the container as QStringList.
References Digikam::ExifToolParser::Private::currentPath, Digikam::ExifToolParser::Private::prepareProcess(), Digikam::ExifToolParser::Private::startProcess(), and Digikam::ExifToolProcess::WRITE_FORMATS.