iPhone photos, EXIF, sideways photos and WordPress

I like to include a good amount of photos in my book reviews and have always followed the same procedure. I take the photos with my iPhone and edit them in Gimp for use in on various WordPress sites. This worked well, until two weeks ago.

I had just completed my review for Will Eisner’s A Contract with God Curator’s Collection and published it. It looked good on the site, which I viewed on my Windows 10 PC with Chrome, but when I checked the social media posts on Facebook and Twitter the featured image was upside down.

I checked the image on the site and it looked fine. Updated the post but the image remained upside down. I chalked it up to social media weirdness and moved on after commenting on Facebook.

This week I posted my next review, Lone Wolf and Cub Gallery Edition. This time the image was sideways on social media.

Both books were from Dark Horse and I was hoping for a retweet and didn’t want to look like a buffoon with incorrect images. Plus I had some time to look into it.

Doing the usual Google search for WordPress and sideways images let to a lot of tutorials on how to edit images within WordPress, which isn’t this. More searching lead to recommendations for two plugins: Image Rotation Fixer and iOS Images Fixer. I don’t like relying on plugins when it can be fixed in WordPress through my child theme, but I wanted to get this fixed. The first one doesn’t seem supported in WordPress any longer, so I read the details of iOS Images Fixer and thought this was my cure.

By default, thumbnails of photos taken by an iOS device (iPhone or iPad) are flipped 90 degrees to the left, it’s a long image EXIF information story. This plugin takes care of this and fixes the uploaded images orientation’s (if needed, based on EXIF data) using ImageMagic Library if available or PHP GD as a fallback.

Installing it let to the plugin saying PHP EXIF_READ_DATA wasn’t installed. Hmm, now we’re getting somewhere. I host my sites on a WHM VPS so I checked my EasyApache4 and saw that wasn’t installed so I added it to my PHP 7 setup.

After updating PHP and reloading the site I saw all the images from the last two posts were sideways. Something had happened with the EXIF information being passed along from my iPhone photos. Thankfully I had this shiny new plugin to fix my issues. I ran it and it found no errors. Odd, since I now had forty-eight sideways images in my media library. I deleted them and added the photos again, in case it was having trouble with existing photos. Nope: iOS Images Fixer still didn’t see a problem. Removed.

Back on my own again, I looked at everything. There must have been an update somewhere that caused this since everything worked previously. Checked iOS updates, WordPress core updates, plugin updates, Gimp updates. Nothing.

Since I couldn’t pinpoint a platform change I would have to revisit my procedure. I was rotating, cropping, resizing, colour adjusting and exporting my photos. For some reason, the EXIF information was maintaining the wrong orientation. I didn’t need the EXIF information so I needed to remove it when exporting the image in Gimp, which is pretty simple. When exporting as JPG click advanced settings, uncheck Save EXIF data, and save default. I ran through my images exporting them again, deleted them from WordPress and uploaded. Everything was looking as it should.

Gimp Export Settings

I went back to check social media and Facebook was now showing the correctly oriented image while Twitter was not, so it looks like Facebook updates its images for links while Twitter does not.