feat: some other exiv metadata for display
This commit is contained in:
parent
e97dfe3a10
commit
13de9bdc4c
|
@ -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;
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -355,66 +355,161 @@
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="68"/>
|
||||
<source>Rating</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="70"/>
|
||||
<source>Comments</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="71"/>
|
||||
<source>Program name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="73"/>
|
||||
<source>Colour representation</source>
|
||||
<source>Authors</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="75"/>
|
||||
<source>Camera maker</source>
|
||||
<source>Date taken</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="77"/>
|
||||
<source>Program name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="80"/>
|
||||
<source>Horizontal resolution</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="82"/>
|
||||
<source>Vertical resolution</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="84"/>
|
||||
<source>Resolution unit</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="86"/>
|
||||
<source>Colour representation</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="89"/>
|
||||
<source>Camera maker</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="91"/>
|
||||
<source>Camera model</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="79"/>
|
||||
<location filename="../app/metadatamodel.cpp" line="93"/>
|
||||
<source>F-stop</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="95"/>
|
||||
<source>Exposure time</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="97"/>
|
||||
<source>ISO speed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="81"/>
|
||||
<location filename="../app/metadatamodel.cpp" line="99"/>
|
||||
<source>Exposure bias</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="101"/>
|
||||
<source>Focal length</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="83"/>
|
||||
<source>Digital zoom</source>
|
||||
<location filename="../app/metadatamodel.cpp" line="103"/>
|
||||
<source>Max aperture</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="85"/>
|
||||
<source>EXIF version</source>
|
||||
<location filename="../app/metadatamodel.cpp" line="105"/>
|
||||
<source>Metering mode</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="94"/>
|
||||
<source>%1 x %2</source>
|
||||
<location filename="../app/metadatamodel.cpp" line="107"/>
|
||||
<source>Flash mode</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="109"/>
|
||||
<source>35mm focal length</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="112"/>
|
||||
<source>Lens model</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="114"/>
|
||||
<source>Brightness</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="116"/>
|
||||
<source>Exposure program</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="118"/>
|
||||
<source>Saturation</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="120"/>
|
||||
<source>Sharpness</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="122"/>
|
||||
<source>White balance</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="124"/>
|
||||
<source>Digital zoom</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="126"/>
|
||||
<source>EXIF version</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="135"/>
|
||||
<source>%1 x %2</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="153"/>
|
||||
<source>%1 : %2</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="240"/>
|
||||
<location filename="../app/metadatamodel.cpp" line="288"/>
|
||||
<source>Property</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="240"/>
|
||||
<location filename="../app/metadatamodel.cpp" line="288"/>
|
||||
<source>Value</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
|
|
@ -355,66 +355,161 @@
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="68"/>
|
||||
<source>Rating</source>
|
||||
<translation>分级</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="70"/>
|
||||
<source>Comments</source>
|
||||
<translation>备注</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="71"/>
|
||||
<location filename="../app/metadatamodel.cpp" line="73"/>
|
||||
<source>Authors</source>
|
||||
<translation>作者</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="75"/>
|
||||
<source>Date taken</source>
|
||||
<translation>拍摄日期</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="77"/>
|
||||
<source>Program name</source>
|
||||
<translation>程序名称</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="73"/>
|
||||
<location filename="../app/metadatamodel.cpp" line="80"/>
|
||||
<source>Horizontal resolution</source>
|
||||
<translation>水平分辨率</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="82"/>
|
||||
<source>Vertical resolution</source>
|
||||
<translation>垂直分辨率</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="84"/>
|
||||
<source>Resolution unit</source>
|
||||
<translation>分辨率单位</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="86"/>
|
||||
<source>Colour representation</source>
|
||||
<translation>颜色表示</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="75"/>
|
||||
<location filename="../app/metadatamodel.cpp" line="89"/>
|
||||
<source>Camera maker</source>
|
||||
<translation>照相机制造商</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="77"/>
|
||||
<location filename="../app/metadatamodel.cpp" line="91"/>
|
||||
<source>Camera model</source>
|
||||
<translation>照相机型号</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="79"/>
|
||||
<location filename="../app/metadatamodel.cpp" line="93"/>
|
||||
<source>F-stop</source>
|
||||
<translation>光圈值</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="95"/>
|
||||
<source>Exposure time</source>
|
||||
<translation>曝光时间</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="97"/>
|
||||
<source>ISO speed</source>
|
||||
<translation>ISO 速度</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="81"/>
|
||||
<location filename="../app/metadatamodel.cpp" line="99"/>
|
||||
<source>Exposure bias</source>
|
||||
<translation>曝光补偿</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="101"/>
|
||||
<source>Focal length</source>
|
||||
<translation>焦距</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="83"/>
|
||||
<location filename="../app/metadatamodel.cpp" line="103"/>
|
||||
<source>Max aperture</source>
|
||||
<translation>最大光圈</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="105"/>
|
||||
<source>Metering mode</source>
|
||||
<translation>测光模式</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="107"/>
|
||||
<source>Flash mode</source>
|
||||
<translation>闪光灯模式</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="109"/>
|
||||
<source>35mm focal length</source>
|
||||
<translation>35mm 焦距</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="112"/>
|
||||
<source>Lens model</source>
|
||||
<translation>镜头型号</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="114"/>
|
||||
<source>Brightness</source>
|
||||
<translation>亮度</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="116"/>
|
||||
<source>Exposure program</source>
|
||||
<translation>曝光程序</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="118"/>
|
||||
<source>Saturation</source>
|
||||
<translation>饱和度</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="120"/>
|
||||
<source>Sharpness</source>
|
||||
<translation>清晰度</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="122"/>
|
||||
<source>White balance</source>
|
||||
<translation>白平衡</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="124"/>
|
||||
<source>Digital zoom</source>
|
||||
<translation>数字缩放</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="85"/>
|
||||
<location filename="../app/metadatamodel.cpp" line="126"/>
|
||||
<source>EXIF version</source>
|
||||
<translation>EXIF 版本</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="94"/>
|
||||
<location filename="../app/metadatamodel.cpp" line="135"/>
|
||||
<source>%1 x %2</source>
|
||||
<translation>%1 x %2</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="112"/>
|
||||
<location filename="../app/metadatamodel.cpp" line="153"/>
|
||||
<source>%1 : %2</source>
|
||||
<translation>%1 : %2</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="240"/>
|
||||
<location filename="../app/metadatamodel.cpp" line="288"/>
|
||||
<source>Property</source>
|
||||
<translation>属性</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../app/metadatamodel.cpp" line="240"/>
|
||||
<location filename="../app/metadatamodel.cpp" line="288"/>
|
||||
<source>Value</source>
|
||||
<translation>值</translation>
|
||||
</message>
|
||||
|
|
Loading…
Reference in New Issue
Block a user