|
Server : Apache System : Linux vps-1289444.devslamantis.cl 3.10.0-1160.139.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Nov 3 13:30:41 UTC 2025 x86_64 User : vspt ( 1013) PHP Version : 7.4.33 Disable Function : NONE Directory : /usr/share/doc/perl-Image-Info-1.33/ |
#!/usr/bin/perl -w
use lib 'lib';
use strict;
use Image::Info qw(image_info);
my $i=image_info($ARGV[0]);
foreach (sort keys %$i) {
if ($i->{$_} =~ /[\001-\037\177-\377]/ && !/error/) {
printf "%s ->\n" ,$_;
hex_print($i->{$_});
next;
}
$i->{$_} =~ s/\000//g;
printf "%s -> %s\n" ,$_, ref($i->{$_}) ? deref(@{$i->{$_}}) : $i->{$_}
};
sub deref {
my @args;
if (ref($_[0]) eq 'ARRAY') {
foreach my $ref (@_) {
push(@args, deref(@{$ref}))
}
} else {
@args = @_;
}
'[' . join(',',@args) . ']';
}
sub hex_print {
for (my $i=0; $i<length $_[0];$i+=16) {
my $ss = substr($_[0],$i,16);
printf " %04x: %s ", $i, join(' ',grep !/^$/,split(/(..)/,unpack("H*",$ss)));
$ss =~ tr /\000-\037\177-\377/./;
print $ss,"\n";
}
}