diff --git a/src/extractionresult.h b/src/extractionresult.h --- a/src/extractionresult.h +++ b/src/extractionresult.h @@ -46,11 +46,19 @@ class KFILEMETADATA_EXPORT ExtractionResult { public: + /** + * Flags which determine which properties shall be extracted. + * @todo KF6 cleanup flag naming + */ enum Flag { ExtractNothing = 0, ExtractMetaData = 1, ExtractPlainText = 2, - ExtractEverything = (ExtractMetaData | ExtractPlainText) + ExtractEverything = (ExtractMetaData | ExtractPlainText), + /** + * @since 5.69 + */ + ExtractImageData = 4, }; Q_DECLARE_FLAGS(Flags, Flag) diff --git a/src/properties.h b/src/properties.h --- a/src/properties.h +++ b/src/properties.h @@ -387,6 +387,14 @@ */ Description, + /** + * Contains the front cover image of e.g. an album as binary + * data. The ExtractionResult::ExtractImageData flag must + * be set to extract this property. + * @since 5.69 + */ + FrontCover, + PropertyCount, LastProperty = PropertyCount-1, diff --git a/src/propertyinfo.cpp b/src/propertyinfo.cpp --- a/src/propertyinfo.cpp +++ b/src/propertyinfo.cpp @@ -578,6 +578,12 @@ d->shouldBeIndexed = false; break; + case Property::FrontCover: + d->name = QStringLiteral("frontCover"); + d->displayName = i18nc("@label", "Front Cover Image"); + d->valueType = QVariant::ByteArray; + break; + case Property::PropertyCount: // To silence the compiler. break; @@ -736,7 +742,8 @@ { QStringLiteral("originurl"), Property::OriginUrl }, { QStringLiteral("originemailsubject"), Property::OriginEmailSubject }, { QStringLiteral("originemailsender"), Property::OriginEmailSender }, - { QStringLiteral("originemailmessageid"), Property::OriginEmailMessageId } + { QStringLiteral("originemailmessageid"), Property::OriginEmailMessageId }, + { QStringLiteral("frontcover"), Property::FrontCover } }; return PropertyInfo(propertyHash.value(name.toLower()));