some more Nikon print functions changed

to translate value 0 to n/a
main
norbertwg 2 years ago
parent d8174f23bc
commit f3c4fb7461

@ -3263,6 +3263,10 @@ std::ostream& Nikon3MakerNote::printFocusDistance(std::ostream& os, const Value&
os.flags(f); os.flags(f);
return os; return os;
} }
auto temp = value.toInt64();
if (temp == 0)
return os << _("n/a");
double dist = 0.01 * pow(10.0, value.toInt64() / 40.0); double dist = 0.01 * pow(10.0, value.toInt64() / 40.0);
std::ostringstream oss; std::ostringstream oss;
oss.copyfmt(os); oss.copyfmt(os);
@ -3279,6 +3283,10 @@ std::ostream& Nikon3MakerNote::printAperture(std::ostream& os, const Value& valu
os.flags(f); os.flags(f);
return os; return os;
} }
auto temp = value.toInt64();
if (temp == 0)
return os << _("n/a");
double aperture = pow(2.0, value.toInt64() / 24.0); double aperture = pow(2.0, value.toInt64() / 24.0);
std::ostringstream oss; std::ostringstream oss;
oss.copyfmt(os); oss.copyfmt(os);
@ -3292,6 +3300,10 @@ std::ostream& Nikon3MakerNote::printFocal(std::ostream& os, const Value& value,
if (value.count() != 1 || value.typeId() != unsignedByte) { if (value.count() != 1 || value.typeId() != unsignedByte) {
return os << "(" << value << ")"; return os << "(" << value << ")";
} }
auto temp = value.toInt64();
if (temp == 0)
return os << _("n/a");
double focal = 5.0 * pow(2.0, value.toInt64() / 24.0); double focal = 5.0 * pow(2.0, value.toInt64() / 24.0);
std::ostringstream oss; std::ostringstream oss;
oss.copyfmt(os); oss.copyfmt(os);
@ -3959,6 +3971,10 @@ std::ostream& Nikon3MakerNote::printFocalLd4(std::ostream& os, const Value& valu
if (value.count() != 1 || value.typeId() != unsignedShort) { if (value.count() != 1 || value.typeId() != unsignedShort) {
return os << "(" << value << ")"; return os << "(" << value << ")";
} }
auto temp = value.toInt64();
if (temp == 0)
return os << _("n/a");
std::ostringstream oss; std::ostringstream oss;
oss.copyfmt(os); oss.copyfmt(os);
os << std::fixed << std::setprecision(1) << value.toInt64() << " mm"; os << std::fixed << std::setprecision(1) << value.toInt64() << " mm";
@ -3970,6 +3986,10 @@ std::ostream& Nikon3MakerNote::printFocusDistanceLd4(std::ostream& os, const Val
if (value.count() != 1 || value.typeId() != unsignedShort) { if (value.count() != 1 || value.typeId() != unsignedShort) {
return os << "(" << value << ")"; return os << "(" << value << ")";
} }
auto temp = value.toInt64();
if (temp == 0)
return os << _("n/a");
double dist = 0.01 * pow(10.0, (value.toInt64() / 256.0) / 40.0); double dist = 0.01 * pow(10.0, (value.toInt64() / 256.0) / 40.0);
std::ostringstream oss; std::ostringstream oss;
oss.copyfmt(os); oss.copyfmt(os);

Binary file not shown.

@ -115,8 +115,8 @@ Exif.NikonLd4.EffectiveMaxAperture Byte 1 36 F2.8
Exif.NikonLd4.LensID Short 1 0 0 Exif.NikonLd4.LensID Short 1 0 0
Exif.NikonLd4.MaxAperture Short 1 0 n/a Exif.NikonLd4.MaxAperture Short 1 0 n/a
Exif.NikonLd4.FNumber Short 1 0 n/a Exif.NikonLd4.FNumber Short 1 0 n/a
Exif.NikonLd4.FocalLength2 Short 1 0 0 mm Exif.NikonLd4.FocalLength2 Short 1 0 n/a
Exif.NikonLd4.FocusDistance2 Short 1 0 0.01 m Exif.NikonLd4.FocusDistance2 Short 1 0 n/a
Exif.Nikon3.RawImageCenter Short 2 2274 1515 2274 1515 Exif.Nikon3.RawImageCenter Short 2 2274 1515 2274 1515
Exif.Nikon3.RetouchHistory Short 10 0 0 0 0 0 0 0 0 0 0 None Exif.Nikon3.RetouchHistory Short 10 0 0 0 0 0 0 0 0 0 0 None
Exif.Nikon3.ShutterCount Long 1 174 174 Exif.Nikon3.ShutterCount Long 1 174 174

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save