Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Digital Camera Picture Header

by pg (Canon)
on Jan 15, 2003 at 21:08 UTC ( #227229=perlquestion: print w/replies, xml ) Need Help??

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://227229]
Approved by ar0n
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2022-11-30 05:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?