From 9349742f0a812cee11d74955bd5d26facd69f8d8 Mon Sep 17 00:00:00 2001 From: Simon Cozens Date: Tue, 6 Feb 2007 20:57:30 +0000 Subject: [PATCH] Expose IPTC tags for viewing. Closes #1. git-svn-id: http://svn.simon-cozens.org/memories/trunk@4 041978f6-d955-411f-a9d7-1d8545c9c3c7 --- Memories/Photo.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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; -- 2.39.5