3 my ($file, $size) = @ARGV;
6 require Image::ExifTool;
7 my $exif = Image::ExifTool->new->ImageInfo($file);
10 $exif->{ImageSize} ? " $exif->{ImageSize} ($exif->{Megapixels}MP)" : (),
12 $exif->{YCbCrSubSampling} // (),
13 $exif->{Interlace} // (),
14 $exif->{Compression} // $exif->{FileType},
15 $exif->{SVGVersion} // $exif->{PDFVersion} // (),
17 $exif->{ColorType} ? " $exif->{BitDepth}bpp $exif->{ColorType}" : (),
18 sprintf(' exif x%d', scalar %{$exif}),
19 $exif->{Thumb} ? " thumb $exif->{ThumbnailLength}B" : (),
21 $exif->{DateCreated} //
22 $exif->{CircaDateCreated} //
23 $exif->{ModifyDate} //
24 $exif->{ZipModifyDate} //
27 $exif->{GPSPosition} ? " $exif->{GPSPosition}" =~ s/ deg/./gr :
28 $exif->{Location} ? " $exif->{Location}" : (),
29 $exif->{GPSAltitude} ? " $exif->{GPSAltitude}" : (),
30 (map " hw $_", join(' ',
31 $exif->{Make} // (), $exif->{Model} // (),
32 $exif->{FOV} ? "(FOV $exif->{FOV})" : (),
34 (map " sw $_", $exif->{Software} // $exif->{Application} // ()),
35 (map " > $_", $exif->{'Description-nl'} // ()),
36 $exif->{Warning} ? " ! $exif->{Warning}" : (),
42 open my $bin, '<', $file;
44 my $md5 = Digest::MD5->new->addfile($bin);
45 push @info, ' # '.$md5->b64digest;
48 open my $pgm, '-|', convert => (
50 '+distort' => SRT => '0,0 1,.56 0',
51 -thumbnail => $size || '66x23',
54 <$pgm> eq "P2\n" or do {
58 <$pgm>; <$pgm>; # ignore depth, dimensions
60 my @ch = split //, " .:coO@";
62 print $ch[ $_ * @ch >> 8 ] for /\d+/g;
63 print $info[$. - 4], $/;