http://qs321.pair.com?node_id=227229

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

I bought a Kodak digital camera recently, but the editing software came with it has some bugs.

For example, one problem is that, whenever I crop a picture, the date on the picture is gone.

So I am thinking of do something myself. I am not interested in the "image", but I am really interested in the header info, which contains the date, etc.

Does any one know whether there is a Perl module for this? Or maybe you even tried one?

If not, maybe you can point me to some document, and I can do something from scrach. If I get the format, I can do whatever I want.

Replies are listed 'Best First'.
(ar0n) Re: Digital Camera Picture Header
by ar0n (Priest) on Jan 15, 2003 at 21:30 UTC
    Well, I suppose it all depends on what fileformat your picture is in. But there's Image::Info (direct link), which allows you to retrieve the Comment field of most standard image types, which is where I'd assume the date would be stored.
Re: Digital Camera Picture Header
by revdiablo (Prior) on Jan 15, 2003 at 23:28 UTC

    A lot of digital cameras store the metadata as EXIF. I could not find any CPAN modules mentioning EXIF, but there is a unix utility (called, quite originally, 'exif') which can read this data, and its output could easily be parsed.

    You can check it out at http://sourceforge.net/projects/libexif

    Update: as the previous poster mentioned, there's Image::Info, which actually does use EXIF for jpeg images.