any batch command to rotate many photos at once?
I took a large number of photos on a trip; many are dupes that I will delete, but as it is, I have over 130 at the moment. Most or all of them are sideways. Is there any command that would save me some time by rotating them all in a batch to the desired position?
|
Imagemagick's convert command. Would be easy to write a bash script.
Check out mogrify too. |
just curious: Usually I process all the images one by one, so rotating is not an issue, because I check every and each picture taken. By the way, the software I use knows the original orientation, so the pictures are adjusted by default. This problem only occurred when non-official tools were used.
|
Quote:
Your image viewer might not be aware of exif rotation data. It depends on what you do with these pictures in the end, but it might not be necessary to do anything at all. |
If you want a GUI, non-opensource, option to rotate a bunch of images at once, there's XNViewMP (available in 32/64 bit for Linux) and it has a "Batch Convert." In the actions section of the batch convert you can choose to rotate the images (among many other things).
It's free for personal use, but not opensource. I like it, mostly because I'm used to the workflow and know where everything is. It has been around forever and I was *really* grateful when they made it into a Linux app. |
Quote:
Fire up a file manager and examine and move (or copy, for the more paranoid of us) all the photos that need to be rotated into a temporary subdirectory, and turn a script loose on those that require rotation in that subdirectory. I might even rename those to something like "img_1234.rotated.jpg" after rotation and before moving them back into the original directory to preserve the original, un-rotated images. |
Do you want to reorder the pixels, or do you want to change the EXIF information?
|
create 2 directories called "notrotated" and "rotated". copy all the image files that need to be rotated into "notrotated". once you know what option for the convert commant will rotate them for you, you can run a command like this:
Code:
(ls -1 notrotated|while read n;do ls -l "notrotated/$n";convert put_options_here "notrotated/$n" "rotated/$n";ls -l "rotated/$n";done) i do bash commands like this a few times every day. |
jpegtran can rotate JPEG images with no loss of image quality.
Code:
for n in *.JPG; do jpegtran -rotate 90 $n >$n-rotate.jpg; done |
Quote:
Quote:
|
I've found that using -auto-orient with ImageMagic convert works nicely to sort out orientation on files. Of course this depends on whether your image source contains relevant orientation information.
|
Quote:
jpegtran should have worked on the OP's photos. Ed |
All times are GMT -5. The time now is 09:57 PM. |