fix: no longer display resolution info for image that not supported such info
This commit is contained in:
parent
c5e48d07ed
commit
e8e7940abe
|
@ -40,10 +40,12 @@ void MetadataModel::setFile(const QString &imageFilePath)
|
||||||
appendSection(QStringLiteral("GPS"), tr("GPS", "Section name."));
|
appendSection(QStringLiteral("GPS"), tr("GPS", "Section name."));
|
||||||
appendSection(QStringLiteral("File"), tr("File", "Section name."));
|
appendSection(QStringLiteral("File"), tr("File", "Section name."));
|
||||||
|
|
||||||
|
if (imgReader.supportsOption(QImageIOHandler::Size)) {
|
||||||
appendProperty(QStringLiteral("Image"), QStringLiteral("Image.Dimensions"),
|
appendProperty(QStringLiteral("Image"), QStringLiteral("Image.Dimensions"),
|
||||||
tr("Dimensions"), imageDimensionsString);
|
tr("Dimensions"), imageDimensionsString);
|
||||||
appendProperty(QStringLiteral("Image"), QStringLiteral("Image.SizeRatio"),
|
appendProperty(QStringLiteral("Image"), QStringLiteral("Image.SizeRatio"),
|
||||||
tr("Aspect ratio"), imageRatioString);
|
tr("Aspect ratio"), imageRatioString);
|
||||||
|
}
|
||||||
if (imgReader.supportsAnimation() && imgReader.imageCount() > 1) {
|
if (imgReader.supportsAnimation() && imgReader.imageCount() > 1) {
|
||||||
appendProperty(QStringLiteral("Image"), QStringLiteral("Image.FrameCount"),
|
appendProperty(QStringLiteral("Image"), QStringLiteral("Image.FrameCount"),
|
||||||
tr("Frame count"), QString::number(imgReader.imageCount()));
|
tr("Frame count"), QString::number(imgReader.imageCount()));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user