Skip to content

Commit

Permalink
feat: add exif copyright info and gif frame count to property dialog
Browse files Browse the repository at this point in the history
also fix some letter case issue in original copywriting.
  • Loading branch information
BLumia committed Apr 16, 2021
1 parent fa4b49d commit 6acafc7
Show file tree
Hide file tree
Showing 11 changed files with 1,054 additions and 866 deletions.
18 changes: 10 additions & 8 deletions app/aboutdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,18 @@ AboutDialog::AboutDialog(QWidget *parent)
const QStringList helpStr {
QStringLiteral("<p>%1</p>").arg(tr("Launch application with image file path as argument to load the file.")),
QStringLiteral("<p>%1</p>").arg(tr("Drag and drop image file onto the window is also supported.")),
QStringLiteral("<p>%1</p>").arg(tr("None of the operations in this application will alter the pictures on disk.")),
QStringLiteral("<p>%1</p>").arg(tr("Context menu option explanation:")),
QStringLiteral("<ul>"),
QStringLiteral("<li><b>%1</b>:<br/>%2</li>").arg(
QCoreApplication::translate("MainWindow", "Stay on top"),
tr("Make window stay on top of all other windows.")
),
QStringLiteral("<li><b>%1</b>:<br/>%2</li>").arg(
QCoreApplication::translate("MainWindow", "Protected mode"),
tr("Avoid close window accidentally. (eg. by double clicking the window)")
),
// blumia: Chain two arg() here since it seems lupdate will remove one of them if we use
// the old `arg(QCoreApp::translate(), tr())` way, but it's worth to mention
// `arg(QCoreApp::translate(), this->tr())` works, but lupdate will complain about the usage.
QStringLiteral("<li><b>%1</b>:<br/>%2</li>")
.arg(QCoreApplication::translate("MainWindow", "Stay on top"))
.arg(tr("Make window stay on top of all other windows.")),
QStringLiteral("<li><b>%1</b>:<br/>%2</li>")
.arg(QCoreApplication::translate("MainWindow", "Protected mode"))
.arg(tr("Avoid close window accidentally. (eg. by double clicking the window)")),
QStringLiteral("</ul>")
};

Expand Down
12 changes: 9 additions & 3 deletions app/metadatamodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ void MetadataModel::setFile(const QString &imageFilePath)
appendProperty(QStringLiteral("Image"), QStringLiteral("Image.Dimensions"),
tr("Dimensions"), imageDimensionsString);
appendProperty(QStringLiteral("Image"), QStringLiteral("Image.SizeRatio"),
tr("Aspect Ratio"), imageRatioString);
tr("Aspect ratio"), imageRatioString);
if (imgReader.supportsAnimation() && imgReader.imageCount() > 1) {
appendProperty(QStringLiteral("Image"), QStringLiteral("Image.FrameCount"),
tr("Frame count"), QString::number(imgReader.imageCount()));
}

appendProperty(QStringLiteral("File"), QStringLiteral("File.Name"),
tr("Name"), fileInfo.fileName());
Expand All @@ -54,9 +58,9 @@ void MetadataModel::setFile(const QString &imageFilePath)
appendProperty(QStringLiteral("File"), QStringLiteral("File.Size"),
tr("Size"), sizeString);
appendProperty(QStringLiteral("File"), QStringLiteral("File.CreatedTime"),
tr("Date Created"), birthTimeString);
tr("Date created"), birthTimeString);
appendProperty(QStringLiteral("File"), QStringLiteral("File.LastModified"),
tr("Date Modified"), lastModifiedTimeString);
tr("Date modified"), lastModifiedTimeString);

Exiv2Wrapper wrapper;
if (wrapper.load(imageFilePath)) {
Expand All @@ -73,6 +77,8 @@ void MetadataModel::setFile(const QString &imageFilePath)
QStringLiteral("Exif.Photo.DateTimeOriginal"), tr("Date taken"));
appendExivPropertyIfExist(wrapper, QStringLiteral("Origin"),
QStringLiteral("Exif.Image.Software"), tr("Program name"));
appendExivPropertyIfExist(wrapper, QStringLiteral("Origin"),
QStringLiteral("Exif.Image.Copyright"), tr("Copyright"));

appendExivPropertyIfExist(wrapper, QStringLiteral("Image"),
QStringLiteral("Exif.Image.XResolution"), tr("Horizontal resolution"));
Expand Down
Loading

0 comments on commit 6acafc7

Please sign in to comment.