iPad images (not) rotated when attached

Started by Chas Large, August 04, 2014, 09:03:06 AM

Previous topic - Next topic

Chas Large

I'm not 100% sure about the problem here but several members on my forum have attached photos to their posts but they appear rotated by 180°. The poster says the images appear correctly on their iPad and I have no reason to doubt them because I believe the iPad is rotating the image depending on the orientation of the device.

I've sort of proved this by getting the original image from the poster via e-mail and when viewed in gmail, Windows Explorer and Windows Photo Gallery it's rotated but when viewed in XNVIEW or Photoplus or uploaded to photobucket it's orientation appears correct.

So I suspect a value in the file metadata (origin?) is causing these programs to rotate the image to appear correct but Windows and SMF (or the browser it's viewed in) to show the image without rotation.

Attached is the original image.

So my question is, does anyone know for sure the reason for this and does anyone know of a fix for SMF to rotate the image automatically to the correct orientation? I've searched the mods to no avail.

My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Arantor

There is no fix at present time.

It is because SMF does not parse the EXIF rotation data in the file. Fixing this is not trivial.

I am currently investigating this for other reasons and I might share the results as a mod once I'm done (since I do need to build this for other reasons, and the code should be transplantable)
Holder of controversial views, all of which my own.


Chas Large

Thanks ‽ Look forward to the info.

If I can help with the mod, feel free to PM.
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Arantor

Thanks but I think it's going to be limited to testing since if I don't know how to make mods by now, something has gone terribly wrong ;D
Holder of controversial views, all of which my own.


Chas Large

Quote from: ‽ on August 04, 2014, 09:14:38 AM
Thanks but I think it's going to be limited to testing since if I don't know how to make mods by now, something has gone terribly wrong ;D
Indeed but s problem shared is a problem doubled oops halved. :D
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Arantor

Parsing the EXIF headers themselves isn't a problem if you have the exif extension installed (seems to be most reputable hosts do these days), it's just doing the rotation can also damage the image by lowering its quality due to JPEG re-compression artefacts.

Doing this in 2.1 is significantly harder due to additional modules for ImageMagick binding.
Holder of controversial views, all of which my own.


jonesH

I used to have this problem on a previous forum (using Aeva) and the only fix I could come up with was to bring up the image on my mobile (iOS, don't know about Android), rotate it to the correct position *regardless* how it loked on the mobile screen, and save it. Then upload it. It would always look in the right position on the forum after this procedure.


It seems to me that iOS rotates the image for its showing purposes but leaves the original exif unaltered. So by me rotating and saving it manually I basically overwrite the exif.

Arantor

iOS is doing *exactly* what the specification of images dictates. It's Aeva etc. fault for not fixing it.
Holder of controversial views, all of which my own.


jonesH

Agree, and not trying to blame iOS, but I had to come up with something quick and that was the best I could do :)

Arantor

Yeah, well, I'm currently looking to replace Aeva *whistle*
Holder of controversial views, all of which my own.


Arantor

FWIW I have been looking at this today. Parsing EXIF without the exif extension installed is proving to be an utter nightmare.

I could see myself building a patch for SMF to support it with the extension but not without, just because it requires a non-trivial amount of code to walk the file and parse all the IFD/SubIFD blocks by hand. I could strip down the Exif class I have, I suppose but it still needs like 90% of it to do that.
Holder of controversial views, all of which my own.


roshaoar

What would be neat is functionality to rotate an image 90 degrees with 1 click, only available to the OP once they've posted an image. Automating it is a bit of a nonstarter I think just because some devices to throw in orientation exif and others don't. Ie my cameras do and I can read it but my daughter's point & shoot doesn't. So making it a user function would work for everyone. But that requires a resave, exif gets lost and I suspect that resave would mean artefact issues because of the quality it was resaved as?

Advertisement: