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

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 https://github.com/Corion/App-Photoimport.

        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 (Canon) 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.

    L*
    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.