Auto Image Orientation

Looking for a MOD? Have a MOD request? Post here for help. (Note: This forum is community supported; phpBB does not have official MOD authors)
Ideas Centre
User avatar
AmigoJack
Registered User
Posts: 5332
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Auto Image Orientation

Post by AmigoJack » Tue Apr 22, 2014 6:29 am

That solution is quick+dirty itself:
  1. ini_set() must be considered to fail.
  2. JPEGs are recompressed (which effectively decreases quality) albeit lossless rotation can be done.
  3. JPEG filename extensions jpe and jfif are not considered.
  4. PNGs with alpha channels will be deranged.
  5. TIFFs are not considered.
  6. BMPs are not considered.
  7. Animated GIFs will be lost and if you're lucky the first frame survives.
  8. All metadata (Exif, IPTC, XMP, JPEG/GIF comments, etc...) is lost, not only that one Exif value for the orientation.
  9. If by design always saving as JPEG potential transparency (PNG, GIF, BMP, TIFF) and animation (GIF) will always be lost.
The worst thing about censorship is ███████████

olsserik
Registered User
Posts: 155
Joined: Tue Aug 21, 2007 6:18 am

Re: Auto Image Orientation

Post by olsserik » Thu Mar 12, 2015 11:05 am

Hi,
I can not get this snippet to work. I´m on 3.0.12 and wonder if someone tried this snippet with this version?
I´ve tried with an untouched functions_upload.php and made all edits. Still nothing happens, no rotate where there should be and not even resizing (The original i uploaded).

Someone that can give me some clues?

Mike Ratledge
Registered User
Posts: 5
Joined: Mon Mar 03, 2014 3:34 am

Re: Auto Image Orientation

Post by Mike Ratledge » Tue Jul 14, 2015 11:53 am

Was this ever implemented in the code base?

I came looking for a solution to the problem and found this admittedly ancient thread.

The site I just inherited uses 3.0.12, and I want to know if 3.0.14 fixes the problem.

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51348
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Auto Image Orientation

Post by Brf » Tue Jul 14, 2015 12:12 pm

What problem? Teaching users to hold their phones properly is beyond the scope of this board.

Mike Ratledge
Registered User
Posts: 5
Joined: Mon Mar 03, 2014 3:34 am

Re: Auto Image Orientation

Post by Mike Ratledge » Tue Jul 14, 2015 12:35 pm

Brf wrote:What problem? Teaching users to hold their phones properly is beyond the scope of this board.
Seriously? It has nothing to do with holding the phone correctly, because it is smart enough to read and respond to the EXIF data. The user never knows that there is a problem, because for them, there isn't - until phpBB gets involved.

No matter what way you hold the phone or tablet, it will display the file correctly - by using orientation code.

phpBB 3.0.12 is not aware of the orientation stored in the files.

User avatar
AmigoJack
Registered User
Posts: 5332
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Auto Image Orientation

Post by AmigoJack » Tue Jul 14, 2015 1:06 pm

Mike Ratledge wrote:orientation stored in the files
Uhm, why doesn't your internet browser in the first place interpret the picture's orientations and auto rotate them? It could be helped by examining pictures for EXIF data and then apply CSS to its presentation. Everything else would result in altering the pictures (instead of its presentation only).
The worst thing about censorship is ███████████

Mike Ratledge
Registered User
Posts: 5
Joined: Mon Mar 03, 2014 3:34 am

Re: Auto Image Orientation

Post by Mike Ratledge » Tue Jul 14, 2015 1:34 pm

AmigoJack wrote:
Mike Ratledge wrote:orientation stored in the files
Uhm, why doesn't your internet browser in the first place interpret the picture's orientations and auto rotate them? It could be helped by examining pictures for EXIF data and then apply CSS to its presentation. Everything else would result in altering the pictures (instead of its presentation only).
The browser does show the picture correctly - even if phpBB is showing it wrong, a when you touch it or click on it, the browser displays it correctly.

Its phpBB that stores it incorrectly to begin with.

That's why the code needs to handle it on upload and not make it sever side.

User avatar
AmigoJack
Registered User
Posts: 5332
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Auto Image Orientation

Post by AmigoJack » Tue Jul 14, 2015 1:55 pm

Mike Ratledge wrote:the code needs to handle it on upload and not make it sever side
You can't mean what you said, because then the internet browser would alter the picture already. phpBB can't force clients to do something - it can only perform server-side. But that would alter the picture, instead of just displaying it "correctly".
Mike Ratledge wrote:The browser does show the picture correctly - even if phpBB is showing it wrong, a when you touch it or click on it, the browser displays it correctly.
Do you mix up thumbnails with originals? Because then phpBB's only lack is to add EXIF data for orientation to the thumbnail aswell.

Can you come up with examples? Also which internet browsers in which versions you experienced.
The worst thing about censorship is ███████████

Mike Ratledge
Registered User
Posts: 5
Joined: Mon Mar 03, 2014 3:34 am

Re: Auto Image Orientation

Post by Mike Ratledge » Tue Jul 14, 2015 2:31 pm

AmigoJack wrote:
Mike Ratledge wrote:the code needs to handle it on upload and not make it sever side
You can't mean what you said, because then the internet browser would alter the picture already. phpBB can't force clients to do something - it can only perform server-side. But that would alter the picture, instead of just displaying it "correctly".
Mike Ratledge wrote:The browser does show the picture correctly - even if phpBB is showing it wrong, a when you touch it or click on it, the browser displays it correctly.
Do you mix up thumbnails with originals? Because then phpBB's only lack is to add EXIF data for orientation to the thumbnail aswell.

Can you come up with examples? Also which internet browsers in which versions you experienced.
When a browser receives HTML if acts differently than it does when it receives a JPG file. The HTML sends context, CSS, etc and the browser doesn't try to fix an embedded image, it simply displays it.

On the other hand, if it gets a JPG file, it looks at the EXIF data to se which way is up in reality regardless of how it was stored.

For example, my Galaxy S3, S4 & S5 or her iPhone all show the graphic "wrong" when embedded in HTML, but correctly if JPG, and it doesn't matter what browser or graphics program is displaying it. They all show the files correctly raw, but as told to in HTML.

Same thing happens on my a Windows or Linux laptops, exactly the same. Again, Firefox, Internet Exploder, Chrome, native Android, iPhone browser - all show them exactly the same.

User avatar
AmigoJack
Registered User
Posts: 5332
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Auto Image Orientation

Post by AmigoJack » Wed Jul 15, 2015 7:26 am

Mike Ratledge wrote:For example, my Galaxy S3, S4 & S5 or her iPhone all show the graphic "wrong" when embedded in HTML
Then my knowledge yet isn't outdated. But you have to admit: if internet browsers are able to read each picture's EXIF data to recognize an orientation tag then why is there no setting to rotate them all?

Yes, I understand that internet browsers interpret data differently and basically they all have to magically make the right choice of instantly interpreting the download (*ML, JPEG/PNG...) or just displaying it (TXT, CSS...) or doing what the average user understands and expects as "download" (EXE, ZIP...).

But if you experience everything as I expect it then I fail to see why specifically phpBB has an issue: opening the original picture should auto rotate it by the client aswell. That's why I asked for distinguishing between thumbnails and originals.
The worst thing about censorship is ███████████

Locked

Return to “[3.0.x] MOD Requests”

Who is online

Users browsing this forum: No registered users and 12 guests