tags:

views:

51

answers:

1

I am using the Image::MetaData::JPEG module to read an image's header information. I have the following:

my @files = </dir/*jpg>;

for (@files) {

my $image = new Image::MetaData::JPEG( $_ ) or die $!;
print $image . "\n"; 
} 

This returns "Image::MetaData::JPEG=HASH(0x189b218)".

I've read through the module but how do I actually get the header info in a usable format?

+1  A: 

print $image prints the representation of the object along with its Hash address.

Read the documentation to see what you need.

Try print $file->get_description();

eumiro
that's it. thx. How do I repair a bad jpg header? I am missing the very last line on a few jpg's....0B <0xd9 EOI>
ginius
@ginius, no idea about that. For my original question I just googled it for you. The documentation is there, try to read it.
eumiro