exiftoolĮxiftool, which is included with the Image::ExifTool Perl library for reading and writing metadata information from images and audio and video files, is extremely handy for manipulating image metadata from the command line. I used a Canon G7 for testing and had to set “Auto Rotate” to on in order for orientation information to be written. You will have to verify that your cameras have this ability and they are correctly configured to set this metadata. Many digital cameras can write the orientation to EXIF tags as you take photos. Note that the rotation offered by these tools relies on the orientation information being correctly set in an image’s metadata. Many JPEG images created by digital cameras also include an embedded thumbnail image, and the tools normally rotate both the image and its thumbnail. The upshot is that you do not needlessly throw away more information from the image due to decompressing the data, rotating it, and then using a lossy compression to save the rotated image data. In this article we’ll take a look at some command-line tools to help you with these tasks.Īlthough JPEG image compression is a “lossy” format, meaning that some information is thrown away at compression time, these tools will allow you to rotate an image multiples of 90 degrees without having to recompress the JPEG image data. You might even want to embed comments right into the image files in such a way that all image viewing tools should be able to harvest and share this metadata. When you return from a trip and copy your digital pictures over to your file server, you might like to rename the image files or (losslessly) rotate them to their correct orientation to make finding and viewing them simpler.