Categories
Admin

Rotated Pictures Should be Fixed for iPad

If you’ve been using an iPad or iPhone with Safari to view the site, then many of the images have likely been screwed. Turns out it was a metadata problem and I’ve finally fixed it.

In a nutshell, I pre-process most of the pictures to keep the filesizes reasonable. I also have to rotate certain pictures when the original is taken with the camera oriented vertically. In these cases, certain metadata is present that Safari processes and causes it to display the picture incorrectly. The fix is simple enough- strip the metadata from the jpg file.

The magical incantation is this:

mogrify -strip picture.jpg

If there are a bunch of pictures spanning multiple folders, try this:

find ./folder -name '*.jpg' | xargs mogrify -strip

The command strips all of the metadata that causes the problems.