Posted on 2010-06-23 12:37:44.45881-07 by alyda
Duplicate tags (Nikon:FlashExposureComp) return different values

Hi Phil,


I had some help from you a while back (2010-02-03) on writing exposure compensation values into keywords if I was shooting in Exposure Bracketing mode.


Command line:

exiftool -sep ", " '-keywords+<EBV: ${Nikon:ExposureBracketValue}, EC: ${EC}' -overwrite_original - +if '$Nikon:ShootingMode =~ "Exposure Bracketing"' *.nef

My .ExifTool_config file looks like this:

%Image::ExifTool::UserDefined = ( 'Image::ExifTool::Composite' => { FN => { Require => 'Nikon:FileNumber', PrintConv => 'sprintf("%07d",$val)', }, SC => { Require => 'Nikon:ShutterCount', PrintConv => 'sprintf("%07d",$val)', }, EC => { Require => { 0 => 'ExposureBracketValue', 1 => 'EXIF:ExposureCompensation', }, ValueConv => '$val[1] - $val[0]', PrintConv => 'Image::ExifTool::Exif::ConvertFraction($val)', }, FEC => { Require => 'Nikon:FlashExposureComp', PrintConv => 'Image::ExifTool::Exif::ConvertFraction($val)', }, }, ); #end

I'm making the switch to a perl script because I can't think of a way to use two '-if' conditions--one for exposure compensation, the other for flash compensation (-if 'not $ExifIFD:Flash =~ "No Flash"')--without making two passes.


It looks like I can get where I want to go if I take advantage of the GetValue, SetNewValue and WriteInfo methods of the Image::ExifTool module: 'SetNewValue - Set the new value for a tag. The routine may be called multiple times to set the values of many tags before using "WriteInfo" to write the new values to an image.'


The problem is that I'm seeing duplicate tags for 'Nikon:FlashExposureComp' and they return different values.


Code:

#!/usr/bin/perl use Image::ExifTool; my $exifTool = new Image::ExifTool; my $filename = '20100619-14320274_0025637_3092117.nef'; my $tag1 = 'ExifIFD:Flash'; my $tag2 = 'Nikon:FlashMode'; my $tag3 = 'Nikon:FlashExposureComp'; my $flash = $exifTool->ImageInfo($filename, $tag1, $tag2, $tag3); foreach (keys %$flash) { print "$_ => $$flash{$_}\n"; }

Returns:

FlashExposureComp (1) => -5/3 FlashExposureComp (2) => -5/3 FlashExposureComp => 0 FlashMode => Fired, TTL Mode Flash => On, Return detected

Help!


Direct Responses: 12799 | Write a response
Posted on 2010-06-24 04:10:28.446355-07 by exiftool in response to 12796
Re: Duplicate tags (Nikon:FlashExposureComp) return different values
The exiftool forum has moved:

http://u88.n24.queensu.ca/exiftool/forum/

P.S. It would be useful if you attached a sample image (which can be done in the new forum).
Direct Responses: 12800 | Write a response
Posted on 2010-06-24 11:49:18.429092-07 by alyda in response to 12799
Re: Duplicate tags (Nikon:FlashExposureComp) return different values

I tried to post in 'ExifTool Forum > General > Metadata > Duplicate tags (Nikon:FlashExposureComp) return different values' twice, but get the following message: 'Your session timed out while posting. Please try to re-submit your message.' I think the problem is that my attachment is too big--25046 KB. Maximum attachment size allowed: 10240 KB, per post: 4


Suggestions?

Direct Responses: 12801 | Write a response
Posted on 2010-06-24 12:11:22.105755-07 by alyda in response to 12800
Re: Duplicate tags (Nikon:FlashExposureComp) return different values

I've posted the message at the ExifTool Forum without the attachment, and noted that it's available for download at http://www.justagirl.us/downloads/20100619-14320274_0025637_3092117.zip. File size: 20.4MB.


Please note: My server is scheduled for upgrade and will not be available between 9:00pm ET Thursday, June 24, 2010, and 3:00am ET Friday, June 25, 2010.


Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.