New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect lense name with Nikon D7200 and Sigma AF 18-250mm f/3.5-6.3 DC OS HSM Macro #4135
Comments
|
Your file DSC_5071.NEF has lens id Your file DSC_5076.NEF has lens id |
|
Sorry. I mixed files and uploaded wrong one. Now I've uploaded correct (which I referred in report) files. 5076 was made with Tamron SP 70-300. |
|
That's interesting. The entry in our database corresponds to the id for fl 250mm. |
|
Sure. |
|
The following patch solves the issue, but as @Beep6581 regularly updates the exif database, I want his ok to apply the patch. diff --git a/rtexif/nikonattribs.cc b/rtexif/nikonattribs.cc
index ac8e69ea..af7efc3a 100644
--- a/rtexif/nikonattribs.cc
+++ b/rtexif/nikonattribs.cc
@@ -949,7 +949,22 @@ const std::map<std::string, std::string> NALensDataInterpreter::lenses = {
{"90 3B 53 80 30 3C 92 0E", "AF-S DX VR Zoom-Nikkor 55-200mm f/4-5.6G IF-ED"},
{"90 40 2D 80 2C 40 4B 0E", "Sigma 18-200mm f/3.5-6.3 II DC OS HSM"},
{"91 54 44 44 0C 0C 4B 06", "Sigma 35mm f/1.4 DG HSM"},
- {"92 2C 2D 88 2C 40 4B 0E", "Sigma 18-250mm f/3.5-6.3 DC Macro OS HSM"},
+ // lens id varies with focal length for this lens
+ {"92 2C 2D 88 2C 40 4B 0E", "Sigma 18-250mm f/3.5-6.3 DC Macro OS HSM"}, // (250mm)
+ {"92 2B 2D 88 2C 40 4B 0E", "Sigma 18-250mm f/3.5-6.3 DC Macro OS HSM"}, // (210mm)
+ {"92 2C 2D 88 2C 40 4B 0E", "Sigma 18-250mm f/3.5-6.3 DC Macro OS HSM"}, // (185mm)
+ {"92 2D 2D 88 2C 40 4B 0E", "Sigma 18-250mm f/3.5-6.3 DC Macro OS HSM"}, // (155mm)
+ {"92 2E 2D 88 2C 40 4B 0E", "Sigma 18-250mm f/3.5-6.3 DC Macro OS HSM"}, // (130mm)
+ {"92 2F 2D 88 2C 40 4B 0E", "Sigma 18-250mm f/3.5-6.3 DC Macro OS HSM"}, // (105mm)
+ {"92 30 2D 88 2C 40 4B 0E", "Sigma 18-250mm f/3.5-6.3 DC Macro OS HSM"}, // (90mm)
+ {"92 32 2D 88 2C 40 4B 0E", "Sigma 18-250mm f/3.5-6.3 DC Macro OS HSM"}, // (75mm)
+ {"92 33 2D 88 2C 40 4B 0E", "Sigma 18-250mm f/3.5-6.3 DC Macro OS HSM"}, // (62mm)
+ {"92 35 2D 88 2C 40 4B 0E", "Sigma 18-250mm f/3.5-6.3 DC Macro OS HSM"}, // (52mm)
+ {"92 37 2D 88 2C 40 4B 0E", "Sigma 18-250mm f/3.5-6.3 DC Macro OS HSM"}, // (44mm)
+ {"92 39 2D 88 2C 40 4B 0E", "Sigma 18-250mm f/3.5-6.3 DC Macro OS HSM"}, // (38mm)
+ {"92 3A 2D 88 2C 40 4B 0E", "Sigma 18-250mm f/3.5-6.3 DC Macro OS HSM"}, // (32mm)
+ {"92 3E 2D 88 2C 40 4B 0E", "Sigma 18-250mm f/3.5-6.3 DC Macro OS HSM"}, // (22mm)
+ {"92 40 2D 88 2C 40 4B 0E", "Sigma 18-250mm f/3.5-6.3 DC Macro OS HSM"}, // (18mm)
{"92 48 24 37 24 24 94 06", "AF-S Zoom-Nikkor 14-24mm f/2.8G ED"},
{"93 48 37 5C 24 24 95 06", "AF-S Zoom-Nikkor 24-70mm f/2.8G ED"},
{"94 40 2D 53 2C 3C 96 06", "AF-S DX Zoom-Nikkor 18-55mm f/3.5-5.6G ED II"},
|
|
Even if the patch is correct, the fix must be made upstream using our metadata source - ExifTool - otherwise the fix will be lost on the next update. I assigned myself so that I remember to report this to them tomorrow. |
|
The changing element in the lens ID is handled programmatically by ExifTool: # Convert unknown LensID values
# Inputs: 0) value, 1) flag for inverse conversion, 2) PrintConv hash ref
sub LensIDConv($$$)
{
my ($val, $inv, $conv) = @_;
return undef if $inv;
# multiple lenses with the same LensID are distinguished by decimal values
if ($$conv{"$val.1"}) {
my ($i, @vals, @user);
for ($i=1; ; ++$i) {
my $lens = $$conv{"$val.$i"} or last;
if ($Image::ExifTool::userLens{$lens}) {
push @user, $lens;
} else {
push @vals, $lens;
}
}
return join(' or ', @user) if @user;
return join(' or ', @vals);
}
# Sigma has been changing the LensID on some new lenses
# and with some Sigma lenses the LensFStops changes! (argh!)
my $pat = $val;
$pat =~ s/^\w+ \w+/.. ../;
my @ids = sort grep /^$pat$/, keys %$conv;
if (@ids) {
# first try different LensFStops (2nd value)
($pat = $val) =~ s/ \w+/ ../;
my @good = grep /^$pat$/, @ids;
return $$conv{$good[0]} if @good;
# then try different LensType (1st value)
($pat = $val) =~ s/^\w+/../;
@good = grep /^$pat$/, @ids;
return "Unknown ($val) $$conv{$good[0]} ?" if @good;
}
return undef;
}https://sourceforge.net/p/exiftool/code/ci/master/tree/lib/Image/ExifTool/Nikon.pm#l7866 |
|
I want to close this issue one way or another. There is no way of having those lens IDs automatically generated on update, for the reason expressed by Phil Harvey of ExifTool:
We could append these IDs to the map manually, but separately from the automatically generated section. @heckflosse would this be ok? diff --git a/rtexif/nikonattribs.cc b/rtexif/nikonattribs.cc
index a1fa28c34..b2066150d 100644
--- a/rtexif/nikonattribs.cc
+++ b/rtexif/nikonattribs.cc
@@ -1148,7 +1148,26 @@ const std::map<std::string, std::string> NALensDataInterpreter::lenses = {
{"FE 53 5C 80 24 24 84 06", "Tamron SP AF 70-200mm f/2.8 Di LD (IF) Macro (A001)"},
{"FE 54 5C 80 24 24 DF 0E", "Tamron SP 70-200mm f/2.8 Di VC USD (A009)"},
{"FE 54 64 64 24 24 DF 0E", "Tamron SP 90mm f/2.8 Di VC USD Macro 1:1 (F004)"},
- {"FF 40 2D 80 2C 40 4B 06", "Sigma 18-200mm f/3.5-6.3 DC"}
+ {"FF 40 2D 80 2C 40 4B 06", "Sigma 18-200mm f/3.5-6.3 DC"},
+
+ // There are cases where one lens uses multiple IDs which change based on the focal length or aperture.
+ // These IDs cannot be listed using ExifTool, and so must be entered manually below.
+ // #4135
+
+ {"92 2B 2D 88 2C 40 4B 0E", "Sigma 18-250mm f/3.5-6.3 DC Macro OS HSM"}, // (210mm)
+ {"92 2C 2D 88 2C 40 4B 0E", "Sigma 18-250mm f/3.5-6.3 DC Macro OS HSM"}, // (185mm)
+ {"92 2D 2D 88 2C 40 4B 0E", "Sigma 18-250mm f/3.5-6.3 DC Macro OS HSM"}, // (155mm)
+ {"92 2E 2D 88 2C 40 4B 0E", "Sigma 18-250mm f/3.5-6.3 DC Macro OS HSM"}, // (130mm)
+ {"92 2F 2D 88 2C 40 4B 0E", "Sigma 18-250mm f/3.5-6.3 DC Macro OS HSM"}, // (105mm)
+ {"92 30 2D 88 2C 40 4B 0E", "Sigma 18-250mm f/3.5-6.3 DC Macro OS HSM"}, // (90mm)
+ {"92 32 2D 88 2C 40 4B 0E", "Sigma 18-250mm f/3.5-6.3 DC Macro OS HSM"}, // (75mm)
+ {"92 33 2D 88 2C 40 4B 0E", "Sigma 18-250mm f/3.5-6.3 DC Macro OS HSM"}, // (62mm)
+ {"92 35 2D 88 2C 40 4B 0E", "Sigma 18-250mm f/3.5-6.3 DC Macro OS HSM"}, // (52mm)
+ {"92 37 2D 88 2C 40 4B 0E", "Sigma 18-250mm f/3.5-6.3 DC Macro OS HSM"}, // (44mm)
+ {"92 39 2D 88 2C 40 4B 0E", "Sigma 18-250mm f/3.5-6.3 DC Macro OS HSM"}, // (38mm)
+ {"92 3A 2D 88 2C 40 4B 0E", "Sigma 18-250mm f/3.5-6.3 DC Macro OS HSM"}, // (32mm)
+ {"92 3E 2D 88 2C 40 4B 0E", "Sigma 18-250mm f/3.5-6.3 DC Macro OS HSM"}, // (22mm)
+ {"92 40 2D 88 2C 40 4B 0E", "Sigma 18-250mm f/3.5-6.3 DC Macro OS HSM"} // (18mm)
};
const TagAttrib nikonISOInfoAttribs[] = {
@Kildor could you upload the sample files again please? |
|
Ping @heckflosse @Kildor |
I've gotten a used lense Sigma AF 18-250mm f/3.5-6.3 DC OS HSM Macro, but RT is not able to recognise correct and full lense name at some images showing it as generic "AF 18-250mm f/3.5-6.3"
Raw files examples:
https://filebin.net/w5deodayzg7hsmap
DSC_5073.NEF -- Sigma AF 18-250mm f/3.5-6.3 DC OS HSM Macro
DSC_5077.NEF -- AF 18-250mm f/3.5-6.3
The only difference I see is focal range, the RT shows correct lense name if range is 250. In any other case it shows uncorrect name.
AboutThisBuild.txt
Version: 5.3
Branch: 5.3
Commit: ec0f793
Commit date: 2017-09-30
Compiler: gcc 7.2.0
Processor: generic x86
System: Windows
Bit depth: 64 bits
Gtkmm: V3.22.0
Lensfun: V0.3.2.0
Build type: release
Build flags: -m64 -mwin32 -mthreads -Wno-aggressive-loop-optimizations -std=c++11 -mtune=generic -Werror=unused-label -fopenmp -Werror=unknown-pragmas -Wall -Wno-unused-result -Wno-deprecated-declarations -DNDEBUG -O3
Link flags: -m64 -mthreads -static-libgcc -mtune=generic -s -O3
OpenMP support: ON
MMAP support: ON
The text was updated successfully, but these errors were encountered: