klemm Posted July 29, 2004 Share Posted July 29, 2004 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 More sharing options...
tyme Posted July 29, 2004 Share Posted July 29, 2004 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 More sharing options...
klemm Posted July 29, 2004 Author Share Posted July 29, 2004 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. <{POST_SNAPBACK}> 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 More sharing options...
tyme Posted July 29, 2004 Share Posted July 29, 2004 sorry, didn't realize this was a digital camera deal. should've known, i don't think anyone would scan 400 images! Link to comment Share on other sites More sharing options...
klemm Posted August 2, 2004 Author Share Posted August 2, 2004 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 More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now