Some of my images have been taken rotated but kept this data. The problem is that, when using mogrify to convert them from JPG to png, that data seems to dissapear. For showing this problem, I think the best is to show the script and an screenshot.
Script with the code. Put it in a text file, give it execution permission, double click, run (from terminal if you wish) and wait a while. All the JPGs in that folder will be converted to png.
#! /bin/bash
echo "Converting JPG to png. Please don't close this window."
mogrify -alpha on -format png *.JPG
mogrify -alpha on -format -alpha on png *.jpg
It works great and adds an alpha channel. This is personally useful when I edit them later, not to add the channel individually.
Now the screenshot that illustrates the problem:
As you can see, the original ones' (JPGs) preview is right, the modified preview is wrong, the Shotwell rendering is right and the GIMP edit is wrong and didn't even say the image was rotated, as it uses to do with other images.
How can I edit my script to preserve the orientation?