Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 38 lines (26 sloc) 765 Bytes
#!/usr/bin/env perl
use warnings;
use strict;
use MIME::Base64;
use Image::ExifTool;
use Path::Class qw( file );
my $max_k = 7.5;
my $img = file(shift || die "Give me an image file.\n");
-e $img || die "Can't find $img, tough guy.\n";
die "That's too big for this kind of thing; ${max_k}K max.\n"
if -s $img > $max_k * 1_024;
my $exif = Image::ExifTool->new;
my $info = $exif->ImageInfo($img->stringify);
use YAML; print YAML::Dump($info);
my $src = sprintf "data:%s;base64,%s",
$src =~ s/\R//g;
print $src, $/;
exit 0;
# For wrapped output.
use Text::Wrap;
$Text::Wrap::columns = 72;
print wrap("", "", $src), $/;