Changeset 4

Show
Ignore:
Timestamp:
02/06/07 20:57:30 (2 years ago)
Author:
simon
Message:

Expose IPTC tags for viewing. Closes #1.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Memories/Photo.pm

    r2 r4  
    175175} 
    176176 
     177my %banned_tags = map { $_ => 1 } 
     178    qw( CodedCharacterSet ApplicationRecordVersion ); 
     179 
    177180sub _exif_info { 
    178181    my $exifTool = new Image::ExifTool; 
    179     $exifTool->Options(Group0 => ['EXIF', 'MakerNotes', 'Composite']); 
     182    $exifTool->Options(Group0 => ['IPTC', 'EXIF', 'MakerNotes', 'Composite']); 
    180183    my $info = $exifTool->ImageInfo(shift->path); 
    181184    my $hash = {}; 
    182185    foreach my $tag ($exifTool->GetFoundTags('Group0')) { 
     186        next if $banned_tags{$tag}; 
    183187         my $group = $exifTool->GetGroup($tag); 
    184188         my $val = $info->{$tag}; 
    185189         next if ref $val eq 'SCALAR'; 
    186          next if $val =~ /^[0\s]*$/
     190         next if $val =~ /^[0\s]*$/ or $val =~ /^nil$/
    187191         $hash->{$group}->{$exifTool->GetDescription($tag)} = $val; 
    188192    }