Skip Menu |

This queue is for tickets about the Image-Info CPAN distribution.

Report information
The Basics
Id: 6083
Status: resolved
Worked: 15 min
Priority: 0/
Queue: Image-Info

People
Owner: TELS [...] cpan.org
Requestors: doug [...] ties.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 1.16
Fixed in: (no value)



Subject: Support for MakerNote for Nikon D70/D100
Attached is a patch (against TIFF.pm in Image::Info 1.16) which implements the ability to read the MakerNote EXIF tags for images created by Nikon D70 or D100 digital SLRs. Note that the patch leaves the EXIF prefix as "NikonD1" for these tags, for compatibility with existing software that's looking for them under that name. I've also added definitions for some more Nikon MakerNote tags, though there are still several undefined that look promising.
--- TIFF.pm.1.16 2004-04-18 09:06:57.000000000 -0400 +++ TIFF.pm 2004-04-21 07:57:59.000000000 -0400 @@ -37,6 +37,7 @@ ); my %nikon2_tags = ( + 0x0001 => "NikonVersion", 0x0002 => "ISOSetting", 0x0003 => "ColorMode", 0x0004 => "Quality", @@ -44,9 +45,12 @@ 0x0006 => "ImageSharpening", 0x0007 => "FocusMode", 0x0008 => "FlashSetting", + 0x0009 => "FlashMetering", + 0x000B => "WBAdjustment", 0x000F => "ISOSelection", 0x0080 => "ImageAdjustment", 0x0082 => "AuxiliaryLens", + 0x0084 => "Lens", 0x0085 => "ManualFocusDistance", 0x0086 => "DigitalZoom", 0x0088 => { __TAG__ => "AFFocusPosition", @@ -56,6 +60,9 @@ pack("xCxx",3) => "Left", pack("xCxx",4) => "Right", }, + 0x008d => "ColorMode", + 0x0090 => "FlashType", + 0x0095 => "NoiseReduction", 0x0010 => "DataDump", ); @@ -307,6 +314,8 @@ "NIKON E990" => [0, 'CoolPix', \%nikon2_tags], "NIKON E995" => [0, 'CoolPix', \%nikon2_tags], "NIKON CORPORATION NIKON D1" => [0, 'NikonD1', \%nikon2_tags], + "NIKON CORPORATION NIKON D70" => [-2, 'NikonD1', \%nikon2_tags], + "NIKON CORPORATION NIKON D100" => [-2, 'NikonD1', \%nikon2_tags], "OLYMPUS OPTICAL CO.,LTD C2000Z" => [8, 'Olympus', \%olympus_tags], "OLYMPUS OPTICAL CO.,LTD C2100UZ" => [8, 'Olympus', \%olympus_tags], "OLYMPUS OPTICAL CO.,LTD C2500L" => [8, 'Olympus', \%olympus_tags], @@ -799,15 +808,27 @@ if ($tag eq 'MakerNote' && exists $makernotes{$self->{Make}.' '.$self->{Model}}) { my ($ifd_off, $tag_prefix, $sub) = @{$makernotes{$self->{Make}.' '.$self->{Model}}}; $self->{tag_prefix} = $tag_prefix; - if ($ifd_off < 0) { + if ($ifd_off == -1) { # fuji kludge - http://www.butaman.ne.jp/~tsuruzoh/Computer/Digicams/exif-e.html#APP4 my $save_endian = $self->{little_endian}; $self->{little_endian} = 1; $ifd_off = $self->unpack("N", substr($val, 8, 4)); $self->add_fields($voff+$ifd_off, $ifds, $sub, $voff); $self->{little_endian} = $save_endian; - } else { - $self->add_fields($voff+$ifd_off, $ifds, $sub); + } elsif ($ifd_off == -2) { + # Nikon D70/D100 kludge -- word "Nikon" and 5 + # bytes of data is tacked to the front of + # MakerNote; all EXIF offsets are relative to + # MakerNote section + my ($nikon_voff); + $nikon_voff = 0; + if (substr($val, 0, 5) eq 'Nikon') { + $nikon_voff = $voff+10; + } + #print "IFD_OFF $ifd_off NIKON_VOFF $nikon_voff\n"; + $self->add_fields($voff+18, $ifds, $sub, $nikon_voff); + } else { + $self->add_fields($voff+$ifd_off, $ifds, $sub) } delete $self->{tag_prefix}; next FIELD;
Thanx I have applied this patch to the v1.17 release. Could you send me a (small!) testimage? Best wishes, Tels
Subject: Re: [rt.cpan.org #6083] Support for MakerNote for Nikon D70/D100
Date: Sat, 28 Jan 2006 08:11:35 -0500 (EST)
To: bug-Image-Info [...] rt.cpan.org
From: "Doug Larrick" <doug [...] ties.org>
via RT wrote: Show quoted text
> Thanx I have applied this patch to the v1.17 release. Could you send me > a (small!) testimage? > > Best wishes, > > Tels > >
You may download a sample file from here: http://jekyl.no-ip.org/doug/dsc_4566.jpg . 1.6 MB. -Doug
On Sat Jan 28 08:12:29 2006, doug@ties.org wrote: Show quoted text
> via RT wrote: > You may download a sample file from here: > http://jekyl.no-ip.org/doug/dsc_4566.jpg . 1.6 MB.
I tested that v1.19 still works with that image (exifdump dumping sensible EXIF information), so I mark this bug as resolved. Thanx a lot! As for improving EXIF support, I looked at the code and it is quite, well, convoluted, has a few bugs and glaring ommissions (like half of the manufacturers aren't know etc). I think it doesn't make sense at all to fix this when there is Image::ExifTool available, which already has a full-featured EXIF parsing engine, plus tests for it :) Best wishes, Tels