Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

JPEG EXIF headers and Perl

by .havoc (Novice)
on Jul 31, 2003 at 17:29 UTC ( [id://279671] : perlquestion . print w/replies, xml ) Need Help??

.havoc has asked for the wisdom of the Perl Monks concerning the following question:

So, I've looked in CPAN, and I've looked at and I've looked here, and I've been unable to find anything on reading/editing/writing the EXIF headers in a JPEG (or other) image file.

I see that Sourceforge has a project for libexim, but no documentation on how to use it. No documentation in /usr/share/doc/packages/libexif, which is already installed on my SuSE notebook. Too much noise when I search Google.

Anyone got any suggestions on where to look for documentation on connecting to libexim? Any ideas on connecting to it from Perl?

Preemptive thanks to the Monks.


Replies are listed 'Best First'.
Re: JPEG EXIF headers and Perl
by Mr. Muskrat (Canon) on Jul 31, 2003 at 17:48 UTC

    I've got some good news and some bad news. The good news is that you can read the EXIF headers with Image::Info (see exifdump) or PerlMagick. The bad news is that as of right now there is not any way that I can find to write EXIF headers. PerlMagick has it on the todo list though.

    See also: EXIF File Format.

Re: JPEG EXIF headers and Perl
by blokhead (Monsignor) on Jul 31, 2003 at 17:36 UTC
    I've used Image::Info for reading exif data -- it's pretty straight forward, but as far as I know it doesn't handle writing.


Re: JPEG EXIF headers and Perl
by Cine (Friar) on Jul 31, 2003 at 21:24 UTC
    This is the code I use
    perl -e 'use Data::Dumper; use Image::Info qw(image_info);my$a=image_i +nfo(shift); print Dumper($a);' dmc_0325.jpg | less

    T I M T O W T D I
Re: JPEG EXIF headers and Perl
by halley (Prior) on Aug 01, 2003 at 15:40 UTC
    If Perl isn't a strict requirement, jhead may be useful. If Perl is a strict requirement, study and reimplement jhead in a Perl module and submit it as Image::EXIF.

    [ e d @ h a l l e y . c c ]

Re: JPEG EXIF headers and Perl
by zentara (Archbishop) on Aug 01, 2003 at 15:02 UTC
    Just to stimulate your curiosity, a tk program has been written which manipulates and displays EXIF info. It's called Martin's Picture Viewer. At mapivi