Image orientation in plupload, using EXIF

Do not post support requests, bug reports or feature requests. Discuss phpBB here. Non-phpBB related discussion goes in General Discussion!
Ideas Centre
Post Reply
sage12
Registered User
Posts: 1
Joined: Fri Feb 23, 2018 10:39 am

Image orientation in plupload, using EXIF

Post by sage12 » Fri Feb 23, 2018 10:41 am

I know this has been an age old discussion on here but as far as I know it hasn't been "solved".

The issue:

Some phones don't rotate images based on the orientation of the camera, resulting in a side-on image with some EXIF data telling the user that it needs to be rotated. When images are displayed in the browser they rotate accordingly, but when they are embedded in IMG tags (like in phpbb) they display in their original form, ignoring the EXIF.

Possible solutions:

- Tell the users their phones are crap and they should get a new one (not ideal ;) )
- Complain that it is the browser's job to handle it better (Firefox can do it in CSS, the others can't)
- Look for the EXIF tag on upload and rotate the image then... followed by stripping the EXIF tag to prevent further browser manipulation

It's the last option I am interested in solving. I know PHPBB uses Plupload to upload images, I believe this support auto-rotation if you use the "preserve-headers = false" flag. I haven't managed to test this yet as I can't see where to set it. Can anyone point me in the right direction?

I apologise if there is an easy solution for this that I haven't seen, but I did do quite a bit of searching.

Any help much appreciated

User avatar
Dog Cow
Registered User
Posts: 2483
Joined: Fri Jan 28, 2005 12:14 am
Contact:

Re: Image orientation in plupload, using EXIF

Post by Dog Cow » Fri Feb 23, 2018 2:47 pm

sage12 wrote:
Fri Feb 23, 2018 10:41 am
- Look for the EXIF tag on upload and rotate the image then... followed by stripping the EXIF tag to prevent further browser manipulation
I like this solution.

Sideways photos is one of the most annoying problems with digital photography and screen display. :x
Moof!
Mac GUI Vault: Retro Apple II & Macintosh computing archive.
Inside Allerton bookMac GUIMac 512K Blog

User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 2625
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.
Contact:

Re: Image orientation in plupload, using EXIF

Post by thecoalman » Fri Feb 23, 2018 2:49 pm

Line 269 of phpbb_root/phpbb/plupload/plupload.php

Find:

Code: Select all

				'resize: {width: %d, height: %d, quality: 85},',
Replace with:

Code: Select all

				'resize: {width: %d, height: %d, quality: 85, preserve_headers: false},',
That should also fix any problems with thumbs, at least if the user has JS enabled.

Holger
Registered User
Posts: 1603
Joined: Tue Mar 12, 2002 3:54 pm
Location: Hannover

Re: Image orientation in plupload, using EXIF

Post by Holger » Wed Feb 28, 2018 8:55 am

I had a programmer add two small icons above the Images so that the users and mods can rotate the images after upload and posting.
Are you looking for a phpBB Expert? Find a phpBB Expert!
Are you a phpBB Expert? Post your resume!
http://www.phpbbexperts.com

fruttama
Registered User
Posts: 5
Joined: Tue May 16, 2017 8:30 pm
Contact:

Re: Image orientation in plupload, using EXIF

Post by fruttama » Fri May 04, 2018 9:05 pm

thecoalman wrote:
Fri Feb 23, 2018 2:49 pm
Line 269 of phpbb_root/phpbb/plupload/plupload.php

Find:

Code: Select all

				'resize: {width: %d, height: %d, quality: 85},',
Replace with:

Code: Select all

				'resize: {width: %d, height: %d, quality: 85, preserve_headers: false},',
That should also fix any problems with thumbs, at least if the user has JS enabled.
It's just me, or 3.2.2 has broken this solution?
Now every single image my user upload is sideway.

Post Reply

Return to “phpBB Discussion”

Who is online

Users browsing this forum: No registered users and 26 guests