qRoundOrZero_T: fix possible assert in qRound

also:
- qRoundOrZero_T: added documentation
- EXR: I don't set the ISO Speed ​​if it's zero.

BUG: 524678
This commit is contained in:
Mirco Miranda
2026-08-26 22:45:12 +00:00
committed by Albert Astals Cid
parent 47ea774621
commit a6027264d4
2 changed files with 18 additions and 10 deletions
+2 -1
View File
@@ -368,7 +368,8 @@ static void readMetadata(const Imf::Header &header, QImage &image)
// shot metadata
if (auto isoSpeed = header.findTypedAttribute<Imf::FloatAttribute>("isoSpeed")) {
image.setText(QStringLiteral(META_KEY_ISOSPEEDRATINGS), QLocale::c().toString(qRound(isoSpeed->value())));
if (auto v = qRoundOrZero(isoSpeed->value()))
image.setText(QStringLiteral(META_KEY_ISOSPEEDRATINGS), QLocale::c().toString(v));
}
if (auto expTime = header.findTypedAttribute<Imf::FloatAttribute>("expTime")) {
image.setText(QStringLiteral(META_KEY_EXPOSURETIME), QLocale::c().toString(expTime->value()));