Merge pull request #2760 from norbertwg/translation-of-value-0-in-Exif.NikonLd4.MaxAperture

Nikon printApertureLd4 translate value 0 to n/a
main
Miloš Komarčević 2 years ago committed by GitHub
commit 1ae47bcfd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1861,7 +1861,7 @@ std::ostream& Nikon3MakerNote::print0x0088(std::ostream& os, const Value& value,
// But when actually in "Single area, Center" this can mean // But when actually in "Single area, Center" this can mean
// that focus was not found (try this in AF-C mode) // that focus was not found (try this in AF-C mode)
// TODO: handle the meaningful case (interacts with other fields) // TODO: handle the meaningful case (interacts with other fields)
os << "N/A"; os << _("n/a");
return os; return os;
} }
@ -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);
@ -3839,16 +3851,16 @@ std::ostream& Nikon3MakerNote::printPictureControl(std::ostream& os, const Value
oss.copyfmt(os); oss.copyfmt(os);
switch (pcval) { switch (pcval) {
case 0: case 0:
os << "Normal"; os << _("Normal");
break; break;
case 127: case 127:
os << "n/a"; os << _("n/a");
break; break;
case -127: case -127:
os << "User"; os << _("User");
break; break;
case -128: case -128:
os << "Auto"; os << _("Auto");
break; break;
default: default:
os << pcval; os << pcval;
@ -3944,6 +3956,9 @@ std::ostream& Nikon3MakerNote::printApertureLd4(std::ostream& os, const Value& v
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 aperture = pow(2.0, value.toInt64() / 384.0 - 1.0); double aperture = pow(2.0, value.toInt64() / 384.0 - 1.0);
std::ostringstream oss; std::ostringstream oss;
@ -3956,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";
@ -3967,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.

@ -113,10 +113,10 @@ Exif.NikonLd4.MaxApertureAtMaxFocal Byte 1 36 F2.8
Exif.NikonLd4.MCUVersion Byte 1 123 123 Exif.NikonLd4.MCUVersion Byte 1 123 123
Exif.NikonLd4.EffectiveMaxAperture Byte 1 36 F2.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 F0.5 Exif.NikonLd4.MaxAperture Short 1 0 n/a
Exif.NikonLd4.FNumber Short 1 0 F0.5 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

@ -473,7 +473,7 @@ Shutter speed value ( ) :
Aperture value ( ) : Aperture value ( ) :
Brightness value ( ) : Brightness value ( ) :
Exposure bias (Exif.Photo.ExposureBiasValue ) : 0 EV Exposure bias (Exif.Photo.ExposureBiasValue ) : 0 EV
Max aperture value (Exif.NikonLd4.MaxAperture ) : F0.5 Max aperture value (Exif.NikonLd4.MaxAperture ) : n/a
Subject distance (Exif.NikonLd4.FocusDistance ) : 2.66 m Subject distance (Exif.NikonLd4.FocusDistance ) : 2.66 m
Light source (Exif.Photo.LightSource ) : Unknown Light source (Exif.Photo.LightSource ) : Unknown
Flash (Exif.Photo.Flash ) : No flash Flash (Exif.Photo.Flash ) : No flash

@ -20,7 +20,7 @@ Exif.NikonLd4.MaxApertureAtMinFocal Byte 1 F2.8
Exif.NikonLd4.MaxApertureAtMaxFocal Byte 1 F2.8 Exif.NikonLd4.MaxApertureAtMaxFocal Byte 1 F2.8
Exif.NikonLd4.EffectiveMaxAperture Byte 1 F2.8 Exif.NikonLd4.EffectiveMaxAperture Byte 1 F2.8
Exif.NikonLd4.LensID Short 1 0 Exif.NikonLd4.LensID Short 1 0
Exif.NikonLd4.MaxAperture Short 1 F0.5 Exif.NikonLd4.MaxAperture Short 1 n/a
Exif.Nikon3.ShutterCount Long 1 174 Exif.Nikon3.ShutterCount Long 1 174
Exif.Photo.LensSpecification Rational 4 70-200mm F2.8 Exif.Photo.LensSpecification Rational 4 70-200mm F2.8
Exif.Photo.LensMake Ascii 6 Exif.Photo.LensMake Ascii 6

Loading…
Cancel
Save