Image uploads and orientation - something is not right.

Get help with installation and running phpBB 3.3.x here. Please do not post bug reports, feature requests, or extension related questions here.
alansh
Registered User
Posts: 34
Joined: Fri May 17, 2024 4:17 pm

Image uploads and orientation - something is not right.

Post by alansh »

In my forum, if I set the attachement image settings to allow any size (so set to 0,0), then any portrait image is displayed rotated to landscape on the thumbnail but is correct when I click on the image to display the full size.

If I change the image size to 8000,8000 (so large enough to cover most images), the thumbnail is displayed correctly, but the full size image is now rotated.

Is there a setting somewhere that will fix this? Or is this a bug in phpbb?

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

Re: Image uploads and orientation - something is not right.

Post by thecoalman »

It's a bug in plupload and since it's third party it won't be fixed by phpBB. There is an unpublished patch here that I have used successfully.

https://github.com/phpbb/phpbb/pull/6131
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
alansh
Registered User
Posts: 34
Joined: Fri May 17, 2024 4:17 pm

Re: Image uploads and orientation - something is not right.

Post by alansh »

Thank you. I've taken the two files mentioned and replaced them. It now works OK as long as I don't use a thumbnail. But if I do, then it doesn't work.

So, it's better but not complete.

Alan
alansh
Registered User
Posts: 34
Joined: Fri May 17, 2024 4:17 pm

Re: Image uploads and orientation - something is not right.

Post by alansh »

The only thing that seems to work is if I allow full sized images and don't have a thumbnail.

Alan
HB
Registered User
Posts: 230
Joined: Mon May 16, 2005 9:30 pm

Re: Image uploads and orientation - something is not right.

Post by HB »

thecoalman wrote: Sat May 18, 2024 9:00 pmThere is an unpublished patch here that I have used successfully.
Thanks! I tried it and it worked as promised. I had been doing the EXIF correction server-side, but I like it being done before being sent. As a test, I used the images from https://github.com/recurser/exif-orientation-examples (see examples below). With this patch to plupload, they are correctly oriented.
Landscape_0.jpg
Landscape_1.jpg
Landscape_2.jpg
Landscape_3.jpg
Landscape_4.jpg
Landscape_5.jpg
Landscape_6.jpg
Landscape_7.jpg
Landscape_8.jpg
You do not have the required permissions to view the files attached to this post.
Dan Kehn
alansh
Registered User
Posts: 34
Joined: Fri May 17, 2024 4:17 pm

Re: Image uploads and orientation - something is not right.

Post by alansh »

thecoalman wrote: Sat May 18, 2024 9:00 pm It's a bug in plupload and since it's third party it won't be fixed by phpBB. There is an unpublished patch here that I have used successfully.

https://github.com/phpbb/phpbb/pull/6131
Can I ask - did you just pull the patches from the above location and replace the two files? Or did you do anything else?

Alan
alansh
Registered User
Posts: 34
Joined: Fri May 17, 2024 4:17 pm

Re: Image uploads and orientation - something is not right.

Post by alansh »

Thinking about it, it's the thumbnail creation that is the issue - not the photo display. Does anyone know which module is used for that?

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

Re: Image uploads and orientation - something is not right.

Post by thecoalman »

alansh wrote: Mon May 20, 2024 1:27 am Thinking about it, it's the thumbnail creation that is the issue - not the photo display. Does anyone know which module is used for that?

Alan
Cameras store the raw file data the same orientation regardless of the cameras orientation. Consider a film camera, if you turn it upside down the negative for that image is upside down relative to the other negatives. Same thing applies with digital images but they will use EXIF orientation to flag "this end up". Browsers and image editing software support this and will rotate the raw file data to correct orientation for display.

That said if the image is not being resized by pluplaod that can cause the thumbnail to have wrong orientation and would be phpBB bug. The full size image should be correct since it has not been manipulated and the browser will correctly display it.

When you have set max dimensions the image is being resized by plupload and it will cause the problem.
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
alansh
Registered User
Posts: 34
Joined: Fri May 17, 2024 4:17 pm

Re: Image uploads and orientation - something is not right.

Post by alansh »

I've got around the issue by installing the lightbox extension. That makes the thumbnails and larger pictures all display in the correct orientation.

Alan

Return to “[3.3.x] Support Forum”