Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.
Important point, though I wouldn't have used the term "non-official" here.
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.
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,804
Rep:
Quote:
Originally Posted by pan64
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.
You could look at the aspect ratio of the images with identify(1) and decide whether they need to be rotated. Not a guarantee that would work in all cases---I tend to do portrait shots of people and landscape shot of, well, landscapes and would not want people or nature arbitrarily rotated.
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.
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:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.