Created
March 4, 2018 11:52
-
-
Save dctabuyz/6edeb07a6f8d7c83a7ca1915bb788f70 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Module::Load 'load'; | |
use Module::Load::Conditional 'can_load'; | |
die 'Image::ExifTool not installed' unless can_load('modules' => {'Image::ExifTool' => 0}); | |
load('Image::ExifTool'); | |
my $e = Image::ExifTool->new; | |
my $f = shift || die 'no file specified'; | |
die "file `$f' not found" unless ( -f $f ); | |
die 'unable to extract exif info' unless $e->ExtractInfo($f); | |
printf("%30s: %s\n", $_, handle_binary($e->GetValue($_))) for ( sort $e->GetFoundTags() ); | |
sub handle_binary | |
{ | |
my $value = shift || ''; | |
return '-- BINARY DATA, NOT PRINTED' if ( ref $value or $value =~ /[^\x20-\x7e]/ ); | |
return $value; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment