Skip Menu |

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

Report information
The Basics
Id: 127051
Status: rejected
Priority: 0/
Queue: Image-ExifTool

People
Owner: Nobody in particular
Requestors: CITRIN [...] cpan.org
Cc:
AdminCc:

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



Subject: $exifTool->GetInfo changes list of tags if tag is not found
When $exifTool->GetInfo is called with arryref to tag list and there is no requested tag in the file, suffix ' (0)' is added to tag name. Expected behavior: don't change tag names (and only add to a tag list new tags if wildcard or group name was used). Test case is attached. E. g. when used on this file: https://golang.org/doc/gopher/biplane.jpg it output is: $VAR1 = ['DateTimeOriginal','Make']; at ./testcase.pl line 18. $VAR1 = \{'Make' => 'EPSON'}; at ./testcase.pl line 25. $VAR1 = ['DateTimeOriginal (0)','Make']; at ./testcase.pl line 26. $VAR1 = ['DateTimeOriginal (0) (0)','Make']; at ./testcase.pl line 29. And I think adding ' (0)' to tag name is a bug.
Subject: testcase.pl
#!/usr/bin/perl # use 5.012; # implies "use strict;" use warnings; use Data::Dumper; local $Data::Dumper::Indent = 0; use Image::ExifTool; my $file = $ARGV[0]; my $exifTool = Image::ExifTool->new(); # $exifTool->Options(Verbose => 1); my @tag_list = qw/DateTimeOriginal Make/; warn Dumper(\@tag_list); $exifTool->ExtractInfo($file); my $info; $info = $exifTool->GetInfo(\@tag_list); warn Dumper(\$info); warn Dumper(\@tag_list); $info = $exifTool->GetInfo(\@tag_list); warn Dumper(\@tag_list);
Thanks for this report, however this is as designed. From the documentation for ImageInfo: ARRAY ref Reference to a list of tag names. On entry, any elements in the list are added to the list of requested tags. Tags with names beginning with '-' are excluded. On return, this list is updated to contain an ordered list of tag keys for the returned information. There will be 1:1 correspondence between the requested tags and the returned tag keys only if the "Duplicates" option is 0 and "Sort" is 'Input'. (With "Duplicates" enabled, there may be more The returned array is a list of tag keys, not tag names. To maintain the 1:1 correspondence (2nd paragraphs), dummy tag keys are inserted for tags that don't exist. - Phil