diff --git a/app/exiv2wrapper.cpp b/app/exiv2wrapper.cpp index 1ec5d82..3401515 100644 --- a/app/exiv2wrapper.cpp +++ b/app/exiv2wrapper.cpp @@ -30,6 +30,7 @@ void Exiv2Wrapper::cacheSection(Collection collection) Iterator it = exifData.begin(), end = exifData.end(); for (; it != end; ++it) { QString key = QString::fromUtf8(it->key().c_str()); + if (it->tagName().substr(0, 2) == "0x") continue; QString label = QString::fromLocal8Bit(it->tagLabel().c_str()); std::ostringstream stream; stream << *it; diff --git a/app/metadatamodel.cpp b/app/metadatamodel.cpp index 640ee0a..bbeda4b 100644 --- a/app/metadatamodel.cpp +++ b/app/metadatamodel.cpp @@ -64,21 +64,62 @@ void MetadataModel::setFile(const QString &imageFilePath) if (wrapper.load(imageFilePath)) { wrapper.cacheSections(); - appendProperty(QStringLiteral("Description"), QStringLiteral("Description.Comments"), - tr("Comments"), wrapper.comment()); + appendExivPropertyIfExist(wrapper, QStringLiteral("Description"), + QStringLiteral("Exif.Image.Rating"), tr("Rating")); + appendPropertyIfNotEmpty(QStringLiteral("Description"), QStringLiteral("Description.Comments"), + tr("Comments"), wrapper.comment()); + appendExivPropertyIfExist(wrapper, QStringLiteral("Origin"), + QStringLiteral("Exif.Image.Artist"), tr("Authors")); + appendExivPropertyIfExist(wrapper, QStringLiteral("Origin"), + QStringLiteral("Exif.Photo.DateTimeOriginal"), tr("Date taken")); appendExivPropertyIfExist(wrapper, QStringLiteral("Origin"), QStringLiteral("Exif.Image.Software"), tr("Program name")); + + appendExivPropertyIfExist(wrapper, QStringLiteral("Image"), + QStringLiteral("Exif.Image.XResolution"), tr("Horizontal resolution")); + appendExivPropertyIfExist(wrapper, QStringLiteral("Image"), + QStringLiteral("Exif.Image.YResolution"), tr("Vertical resolution")); + appendExivPropertyIfExist(wrapper, QStringLiteral("Image"), + QStringLiteral("Exif.Image.ResolutionUnit"), tr("Resolution unit")); appendExivPropertyIfExist(wrapper, QStringLiteral("Image"), QStringLiteral("Exif.Photo.ColorSpace"), tr("Colour representation")); + appendExivPropertyIfExist(wrapper, QStringLiteral("Camera"), QStringLiteral("Exif.Image.Make"), tr("Camera maker")); appendExivPropertyIfExist(wrapper, QStringLiteral("Camera"), QStringLiteral("Exif.Image.Model"), tr("Camera model")); + appendExivPropertyIfExist(wrapper, QStringLiteral("Camera"), + QStringLiteral("Exif.Photo.FNumber"), tr("F-stop")); + appendExivPropertyIfExist(wrapper, QStringLiteral("Camera"), + QStringLiteral("Exif.Photo.ExposureTime"), tr("Exposure time")); appendExivPropertyIfExist(wrapper, QStringLiteral("Camera"), QStringLiteral("Exif.Photo.ISOSpeedRatings"), tr("ISO speed")); + appendExivPropertyIfExist(wrapper, QStringLiteral("Camera"), + QStringLiteral("Exif.Photo.ExposureBiasValue"), tr("Exposure bias")); appendExivPropertyIfExist(wrapper, QStringLiteral("Camera"), QStringLiteral("Exif.Photo.FocalLength"), tr("Focal length")); + appendExivPropertyIfExist(wrapper, QStringLiteral("Camera"), + QStringLiteral("Exif.Photo.MaxApertureValue"), tr("Max aperture")); + appendExivPropertyIfExist(wrapper, QStringLiteral("Camera"), + QStringLiteral("Exif.Photo.MeteringMode"), tr("Metering mode")); + appendExivPropertyIfExist(wrapper, QStringLiteral("Camera"), + QStringLiteral("Exif.Photo.Flash"), tr("Flash mode")); + appendExivPropertyIfExist(wrapper, QStringLiteral("Camera"), + QStringLiteral("Exif.Photo.FocalLengthIn35mmFilm"), tr("35mm focal length")); + + appendExivPropertyIfExist(wrapper, QStringLiteral("AdvancedPhoto"), + QStringLiteral("Exif.Photo.LensModel"), tr("Lens model")); + appendExivPropertyIfExist(wrapper, QStringLiteral("AdvancedPhoto"), + QStringLiteral("Exif.Photo.BrightnessValue"), tr("Brightness")); + appendExivPropertyIfExist(wrapper, QStringLiteral("AdvancedPhoto"), + QStringLiteral("Exif.Photo.ExposureProgram"), tr("Exposure program")); + appendExivPropertyIfExist(wrapper, QStringLiteral("AdvancedPhoto"), + QStringLiteral("Exif.Photo.Saturation"), tr("Saturation")); + appendExivPropertyIfExist(wrapper, QStringLiteral("AdvancedPhoto"), + QStringLiteral("Exif.Photo.Sharpness"), tr("Sharpness")); + appendExivPropertyIfExist(wrapper, QStringLiteral("AdvancedPhoto"), + QStringLiteral("Exif.Photo.WhiteBalance"), tr("White balance")); appendExivPropertyIfExist(wrapper, QStringLiteral("AdvancedPhoto"), QStringLiteral("Exif.Photo.DigitalZoomRatio"), tr("Digital zoom")); appendExivPropertyIfExist(wrapper, QStringLiteral("AdvancedPhoto"), @@ -124,6 +165,13 @@ bool MetadataModel::appendSection(const QString §ionKey, const QString § return true; } +bool MetadataModel::appendPropertyIfNotEmpty(const QString §ionKey, const QString &propertyKey, const QString &propertyDisplayName, const QString &propertyValue) +{ + if (propertyValue.isEmpty()) return false; + + return appendProperty(sectionKey, propertyKey, propertyDisplayName, propertyValue); +} + bool MetadataModel::appendProperty(const QString §ionKey, const QString &propertyKey, const QString &propertyDisplayName, const QString &propertyValue) { if (!m_sections.contains(sectionKey)) { diff --git a/app/metadatamodel.h b/app/metadatamodel.h index 9112d39..2255b34 100644 --- a/app/metadatamodel.h +++ b/app/metadatamodel.h @@ -16,6 +16,8 @@ public: static QString imageSize(const QSize &size); static QString imageSizeRatio(const QSize &size); bool appendSection(const QString & sectionKey, const QString & sectionDisplayName); + bool appendPropertyIfNotEmpty(const QString & sectionKey, const QString & propertyKey, + const QString & propertyDisplayName, const QString & propertyValue = QString()); bool appendProperty(const QString & sectionKey, const QString & propertyKey, const QString & propertyDisplayName, const QString & propertyValue = QString()); bool updateProperty(const QString & propertyKey, const QString & propertyValue); diff --git a/translations/PineapplePictures.ts b/translations/PineapplePictures.ts index 1c55cae..a58f1b4 100644 --- a/translations/PineapplePictures.ts +++ b/translations/PineapplePictures.ts @@ -355,66 +355,161 @@ + Rating + + + + Comments - - - Program name - - - Colour representation + Authors - Camera maker + Date taken + Program name + + + + + Horizontal resolution + + + + + Vertical resolution + + + + + Resolution unit + + + + + Colour representation + + + + + Camera maker + + + + Camera model - + + F-stop + + + + + Exposure time + + + + ISO speed - + + Exposure bias + + + + Focal length - - Digital zoom + + Max aperture - - EXIF version + + Metering mode - - %1 x %2 + + Flash mode + + + + + 35mm focal length + Lens model + + + + + Brightness + + + + + Exposure program + + + + + Saturation + + + + + Sharpness + + + + + White balance + + + + + Digital zoom + + + + + EXIF version + + + + + %1 x %2 + + + + %1 : %2 - + Property - + Value diff --git a/translations/PineapplePictures_zh_CN.ts b/translations/PineapplePictures_zh_CN.ts index adfc764..c397460 100644 --- a/translations/PineapplePictures_zh_CN.ts +++ b/translations/PineapplePictures_zh_CN.ts @@ -355,66 +355,161 @@ + Rating + 分级 + + + Comments 备注 - + + Authors + 作者 + + + + Date taken + 拍摄日期 + + + Program name 程序名称 - + + Horizontal resolution + 水平分辨率 + + + + Vertical resolution + 垂直分辨率 + + + + Resolution unit + 分辨率单位 + + + Colour representation 颜色表示 - + Camera maker 照相机制造商 - + Camera model 照相机型号 - + + F-stop + 光圈值 + + + + Exposure time + 曝光时间 + + + ISO speed ISO 速度 - + + Exposure bias + 曝光补偿 + + + Focal length 焦距 - + + Max aperture + 最大光圈 + + + + Metering mode + 测光模式 + + + + Flash mode + 闪光灯模式 + + + + 35mm focal length + 35mm 焦距 + + + + Lens model + 镜头型号 + + + + Brightness + 亮度 + + + + Exposure program + 曝光程序 + + + + Saturation + 饱和度 + + + + Sharpness + 清晰度 + + + + White balance + 白平衡 + + + Digital zoom 数字缩放 - + EXIF version EXIF 版本 - + %1 x %2 %1 x %2 - + %1 : %2 %1 : %2 - + Property 属性 - + Value