From: Simon Cozens Date: Tue, 6 Feb 2007 20:57:30 +0000 (+0000) Subject: Expose IPTC tags for viewing. Closes #1. X-Git-Tag: 1.2+svn20070808~64 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=9349742f0a812cee11d74955bd5d26facd69f8d8;p=memories.git Expose IPTC tags for viewing. Closes #1. git-svn-id: http://svn.simon-cozens.org/memories/trunk@4 041978f6-d955-411f-a9d7-1d8545c9c3c7 --- diff --git a/Memories/Photo.pm b/Memories/Photo.pm index 4e2a59d..a0c3f1b 100644 --- a/Memories/Photo.pm +++ b/Memories/Photo.pm @@ -174,16 +174,20 @@ sub exif_info { $info; } +my %banned_tags = map { $_ => 1 } + qw( CodedCharacterSet ApplicationRecordVersion ); + sub _exif_info { my $exifTool = new Image::ExifTool; - $exifTool->Options(Group0 => ['EXIF', 'MakerNotes', 'Composite']); + $exifTool->Options(Group0 => ['IPTC', 'EXIF', 'MakerNotes', 'Composite']); my $info = $exifTool->ImageInfo(shift->path); my $hash = {}; foreach my $tag ($exifTool->GetFoundTags('Group0')) { + next if $banned_tags{$tag}; my $group = $exifTool->GetGroup($tag); my $val = $info->{$tag}; next if ref $val eq 'SCALAR'; - next if $val =~ /^[0\s]*$/; + next if $val =~ /^[0\s]*$/ or $val =~ /^nil$/; $hash->{$group}->{$exifTool->GetDescription($tag)} = $val; } return $hash;