Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Fetch image attributes

by AlexTape (Monk)
on Jan 28, 2014 at 08:49 UTC ( #1072328=perlquestion: print w/replies, xml ) Need Help??

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

Hey monks,

i meditate about resorting my image archive. what would be your approach to do that?

i think about sorting like

Year -> Month -> (maybe) Event

as hierarchic folder structure.

so - what would be the perlish/best way to fetch attributes out of different image formats (png,jpg,gif,..) like date of change, creation date, ...

kindly AlexTape
$perlig =~ s/pec/cep/g if 'errors expected';

Replies are listed 'Best First'.
Re: Fetch image attributes
by Corion (Patriarch) on Jan 28, 2014 at 08:56 UTC

    I use Image::ExifTool extensively. It allows convenient access to the date/time when a photo was taken (according to the camera clock).

    I also wrote my own photo importer, that sorts photos into buckets according to their timestamp. Gaps of four hours between photos indicate a new "event" (= directory) to the program. That program is quite rough, so I haven't put it online yet. Also, it is relatively trivial to implement.

      so, maybe you want to share your work with us ;)?
      $perlig =~ s/pec/cep/g if 'errors expected';

        Thank you for prodding me. I've just published the code on Github at

        I noticed that in the app, there are some hardcoded Windows-oriented defaults. Especially, the drive letters for removable media are hardcoded. Patches would be welcome to make this more DWIMish, on Windows but also on other operating systems.

Re: Fetch image attributes
by Discipulus (Abbot) on Jan 28, 2014 at 09:19 UTC
    yes, use the module suggested by Corion, see also GTK2 Exif Thumbnail Reader to use it to automagically create a thumbnail.

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (4)
As of 2022-12-04 19:38 GMT
Find Nodes?
    Voting Booth?

    No recent polls found