December 2008
  Sun Mon Tue Wed Thu Fri Sat  
    1 2 3 4 5 6  
  7 8 9 10 11 12 13  
  14 15 16 17 18 19 20  
  21 22 23 24 25 26 27  
  28 29 30 31        

Archives

March 2009 (1)
January 2009 (1)
December 2008 (3)
September 2008 (2)
April 2008 (3)
March 2008 (2)
February 2008 (7)
January 2008 (1)
October 2007 (1)

December 6, 2008

Does Ipernity scale?

Lately I have the impression that Ipernity is acting sloooooow.

Published at 13:21 / 3 comments / 250 visits
This post is public

December 18, 2008

The year 2008 in photographs - boston.com

Pictures speak louder than words.

Take your time and have a look at incredible shots at boston.com that document events of this year.
Obviously quite a range of the 40 photos presented there at the moment (it is part one of three) does not document an untroubled beauty but the dark sides of our world such as natural and man-made disasters.

These pictures, as atrocious the scenes some may show are, do one thing very well: capture emotions, evoke emotions and many rip right into the heart of the viewer.

I believe this is one of the great qualities - as well as a hazard, of course - of photography.

If you have a quarter of an hour to spend then I would say use it to have a look at The year 2008 in photographs.

Published at 14:58 / 8 comments / 324 visits
This post is public

December 21, 2008

[RFH] Identifiying landscape / portrait format images via CLI

OK, now this has been bugging me since I-don't-know-when and since here at Ipernity there are tons of people that deal with images and computing all the time I'll seek help here.

The task is really simple: filter out landscape / portrait format images from a pool of pictures.

I'd like this to happen on the command-line - if possible with out-of-the-box tools and not with special software.
If it were a cross-platform solution, that'd be great but primarily I need a Linux-based idea.

It would be nice if in the end I had a simple script that I tell a directory (possibly with subdirectories to look into recursively) with images. It "scans" these images for their height and width values, figures out if they are oriented in landscape (width > height) or portrait (height > width) or square (width = height) and prints out a list of filenames of the previously defined format.

This list could then be directed into a text-file or piped to another program etc.

Possible tools could be the "identify"-command from the great Imagemagick toolbox or maybe the "list"-option from the equally great feh image viewer.

Both are capable of figuring out the dimensions of an image.

Probably identifiy is the better choice since it allows a range of operations on the parameters of an image-readout.
It can also read out EXIF information.

[Update]
OK, maybe another possibility would be the excellent Perl library exiftool which - as its name suggests - is a Swiss-Army-knife to read/manipulate metadata.
You can specify certain tags to be read out such as ImageSize which will present you directly with the desired values.

I just learned that the identify-command has a similar option.
[Update]

[First possible solution]
for a in *; do identify -format "%f:%[fx:w/h]" $a; done

This will print out the filename (%f) followed by a colon and then the result of width divided by height (fx:w/h), e. g.
img_1654.jpg:1.5
img_1655.jpg:0.666667

It's fast and the CPU load looks reasonable even though not necessarily light.

Next steps are probably filtering out the pictures of the desired orientation (>1, <1, =1) and printing out the filenames.

I'm not sure if what I am doing here is really clever or just script-kiddie hacking.
[First possible solution]

[Quick-and-dirty solution for the moment]
Ok, now this will do for the moment but it's not really much more than a command-combination that needs to be turned into a proper script with input possibilites.

for a in *jpg; do identify -format "%[fx:w/h]%%%f" $a; done | sort | grep ^1 -v | sed 's/.*%//g'

As explained above this uses the identify-command from the ImageMagick toolbox to extract width and height of images. These values are divided and printed out in the form result%filename. This is now sorted so the portrait format pictures (< 1) are displayed first, followed by possible squares and then the landscape format ones. Doing an inverted grep of all lines with a 1 at the beginning sorts out only those in portrait layout. Using sed the numbers are eliminated and only the filenames remain.

Not really super-great but OK.

I would still be glad about input and advice. :)
[Quick-and-dirty solution for the moment]

I wonder what is the best way to go about this task, especially which is the fastest and less CPU-intense way.
Is it easier to read out the EXIF information and work with that because only the image headers need to be processed? feh - as far as I understand - loads the whole image to determine its dimensions and this takes time and calculation, esp. on large images.

I would be really thankful for ideas, hints to other people that may have challenged this idea before etc.

Thank you and - while I'm at it - merry christmas. :)

Published at 14:04 / 2 comments / 393 visits
This post is public

( 3 posts )

 

Català | Čeština nové | 中文 | Deutsch | English | Español | Esperanto | Ελληνικά | Français | Galego | Italiano | Nederlands | Português | More...