Jump to content

Preparing Large ammount of images to the web


klemm
 Share

Recommended Posts

Hi

I have around 400 images I want to put up to the web. That requires the conversion of the images to smaller images and thumbnails.

 

I have used 'mogrify' to do the conversion, but have an issue where I need help.

Is there a command or option that would read the exif data from the image and understand the orjentation of the image (like vertical or horisontal)

Half of the images were shot vertically and I need to have the thmbnails and images with right orjentation after the conversion (verical images rotated by 90 deg.)

 

I'v made a small script that would dig through the directories and make the conversion so I also need to have the rotation made automatically where it is needed

 

Any advise here ?

 

 

Kristjan

Link to comment
Share on other sites

there's really no way to do this as determining "up" from "down" and "left" from "right" is a purely human vision thing. a program can't determine from the code what the orientation of the image should be, AFAIK.

Link to comment
Share on other sites

there's really no way to do this as determining "up" from "down" and "left" from "right" is a purely human vision thing.  a program can't determine from the code what the orientation of the image should be, AFAIK.

 

Images are made with a digicamera (canon G5) that does determin it in the image data.

And Kuickshow can determine that correctly. I dont have to do any rotating when I browse the images with Kuickshow while IrfanView (in windows) does not understand it and the images need to be rotated to view properly

Based on that I did assume that it is possible to determine it automatically and do the rotation also.

 

Kristjan

Link to comment
Share on other sites

Just if anyone else gets into the same question again.

That small script would go through all the directory and convert the images to smaller ones, Also rotates them when needed, so that the result would be all images with right orjentation, ready to FTP to web.

 

 

#!/bin/bash
for FILE in $( ls *.jpg ); do
if [ $( identify $FILE -format %[EXIF:Orientation] ) = 6 ]
 then
nice mogrify -rotate 90 -resize 640x480 $FILE
 else
nice mogrify -resize 640x480 $FILE
fi
done  
exit

 

Kristjan

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...