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!
Suggested Hosts
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 2813
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.
Contact:

Re: Image orientation in plupload, using EXIF

Post by thecoalman » Sun Nov 04, 2018 4:30 am

tojag wrote:
Sun Oct 28, 2018 9:57 pm
Is it possible that the image published from the iPad displays wrong, and the same image published from another system displays correctly? It seems impossible.
EXIF orientation can be quite confusing if not handled properly. For example suppose you were using editing software that doesn't support it. The image would be oriented wrong. You rotate the raw file data and save, the EXIF orientation is preserved . Loks fine in the editor but when you view it in something that does support it now it's flipped again. LOL... That's worse case because the orientation is no longer accurate.

How this applies here is as I just mentioned in previous post the thumbnails are not handled by plupload. The EXIF data is stripped when thumbnails are created so they will always have wrong orientation if they are oriented with EXIF.

User avatar
KYPREO
Registered User
Posts: 80
Joined: Fri Feb 02, 2018 9:56 am
Contact:

Re: Image orientation in plupload, using EXIF

Post by KYPREO » Tue Nov 06, 2018 2:49 am

thecoalman wrote:
Sun Nov 04, 2018 4:20 am
KYPREO wrote:
Sat Oct 27, 2018 11:15 am
But, the attachments don't render in post with the correct orientation. However, if you open the direct URL of the uploaded image in a new tab it is correctly oriented. The means the EXIF data is just being retained and properly interpreted by the browser, but not phpBB.
Plupload only handles the full size image it doesn't handle the thumbnail.
Thanks for the reply. I don't think that's it because I don't use thumbnails for attachments on my forum at all. The file size attachment is not being rendered with correct rotation within phpBB.
phpBB user since 2002
www.AusRotary.com

User avatar
KYPREO
Registered User
Posts: 80
Joined: Fri Feb 02, 2018 9:56 am
Contact:

Re: Image orientation in plupload, using EXIF

Post by KYPREO » Fri Nov 09, 2018 12:50 pm

Well I just managed to fix it!

I implemented this change to /phpbb/plupload/plupload.php (around line 269):

From

Code: Select all

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

Code: Select all

'resize: {width: %d, height: %d, quality: 85,preserve_headers: false},',
Previously this edit did nothing for me. Now, with the new version of plupload it works. Image is correctly orientated according to EXIF data and then the EXIF data is then stripped. 8-)

I know v12mike was able to get it working without this code change, but for me it was required. I will do some more testing, but all the test images and sample photos taken in landscape mode on my Samsung S9+ now display as they should.
phpBB user since 2002
www.AusRotary.com

benwtf
Registered User
Posts: 6
Joined: Mon Nov 05, 2018 10:52 pm

Re: Image orientation in plupload, using EXIF

Post by benwtf » Mon Dec 03, 2018 6:54 am

Testing with an image provided by a user who complained, I was able to use this extension with max dimensions set in attachments with no code modifications in 3.2.4.

Thank you!

EDIT: The extension here: viewtopic.php?f=456&t=2477256&p=15143616#p15143616
That's where I meant to post

Post Reply

Return to “phpBB Discussion”

Who is online

Users browsing this forum: No registered users and 28 guests