Page 1 of 4

[3.2][ALPHA] EXIR - Exif Image Rotation

Posted: Thu Jun 28, 2018 5:50 pm
by 3Di
Extension Name: Exif Image Rotation
Author: 3Di
Author note: Based on the AmigoJack's work here.

Extension Description: Auto rotates attachment images with exif data 'Orientation'
Check for free your IMGs for 'Orientation': https://www.get-metadata.com/

Author note (2): The destination IMG will be manipulated using memory resources, image rotation might fail because of needing much memory, the outcome is always a re-encoded picture, which means no (quality) lossless operation is involved. As per default the quality is set to 95, which preserves the filesize approx., bringing you a decent image quality, good I can say. All of the Exif metadata will be stripped with this operation. Creator: gd-jpeg v1.0 (using IJG JPEG v90), quality = 95.

Extension Version: 1.0.0-alpha

Requirements: phpBB => 3.2.2, PHP => 5.5, PHP extension 'exif'.
Extra Requirements: The extension works, as well as with all the other pre-existing requirements, only if the
  • ACP/attachments settings "Maximum image dimensions:" is set to 0x0.
Extension Download: https://github.com/3D-I/phpBB-Exif-Imag ... master.zip
Extension installation: Copy the extension to ./ext/threedi/exir

Re: [3.2][ALPHA] EXIR - Exif Image Rotation

Posted: Thu Jun 28, 2018 5:50 pm
by 3Di
Here is how a 🐞 bug should be reported. https://github.com/3D-I/phpBB-Exif-Imag ... new/choose
phpBB version:


PHP version:


Any hard-coded snippet?


Any other attachment's related extension installed, if yes which one:



Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

Smartphone (please complete the following information):
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

Additional context
Add any other context about the problem here.

Re: [3.2][ALPHA] EXIR - Exif Image Rotation

Posted: Thu Jun 28, 2018 5:54 pm
by </Solidjeuh>
This will be a great ext! But not gonna install Alpha.. :)
This only works for attachments? Would be great if it also works with "Dmzx Image Upload": https://www.dmzx-web.net/viewtopic.php?t=2464#p14597

Re: [3.2][ALPHA] EXIR - Exif Image Rotation

Posted: Thu Jun 28, 2018 6:01 pm
by 3Di
Froddelaar wrote:
Thu Jun 28, 2018 5:54 pm
This will be a great ext! But not gonna install Alpha.. :)
I will change the prefix to RC if you want :lol: Or use it on a test board, you know already the answer. :P

Btw, how can I go RC if no one tries it before becoming a tester? Bah.. :?

This will work only with attachments, if those have any exif data 'orientation' that can be read.
Else no logic will be applied, like if the extension is not active.

Re: [3.2][ALPHA] EXIR - Exif Image Rotation

Posted: Thu Jun 28, 2018 6:07 pm
by 3Di
Extension available for download (1.0.0-alpha), see first post.

Re: [3.2][ALPHA] EXIR - Exif Image Rotation

Posted: Thu Jun 28, 2018 10:12 pm
by fagbutlil
Took 2 pics samsung s8 1 landscap 1 the other way posted and only the 1 was the right way dunt know if thats how its ment to work or not?

Re: [3.2][ALPHA] EXIR - Exif Image Rotation

Posted: Thu Jun 28, 2018 10:21 pm
by 3Di
fagbutlil wrote:
Thu Jun 28, 2018 10:12 pm
Took 2 pics samsung s8 1 landscap 1 the other way posted and only the 1 was the right way dunt know if thats how its ment to work or not?
Please plain English, I am not a native speaker, I don't slang either. :)

I've got:
I took 2 pics with a Samsung s8, one in landscape and one in portrait,.. :?:
... from this point I am lost. :?

Re: [3.2][ALPHA] EXIR - Exif Image Rotation

Posted: Thu Jun 28, 2018 11:20 pm
by fagbutlil
Plain english then it did not rotate :lol: failed to work no workie.

I landed up taking a selfie for the sake of it.

Re: [3.2][ALPHA] EXIR - Exif Image Rotation

Posted: Thu Jun 28, 2018 11:23 pm
by KYPREO
Great work on taking on this important fix!
fagbutlil wrote:
Thu Jun 28, 2018 10:12 pm
Took 2 pics samsung s8 1 landscap 1 the other way posted and only the 1 was the right way dunt know if thats how its ment to work or not?
This could be because the photo was not actually taken in portrait. I have a Samsung 8 and it is sometimes a bit slow for the position sensor to recognise the orientation of the phone. To ensure this was not a case of user error, perhaps take another photo but ensure the orientation icon is definitely in portrait mode.

Otherwise there is something else going on. Perhaps the way Samsung 8 implements EXIF orientation data?

The ideal fix for this would be to have rotate icon next to attachments or inline attachments in the preview window, allowing the user to see the orientiation error and fix it in the post itself. This is the best fix IMO as it overcomes user error and allows users to go back and edit a post if they their attachment isn't properly rotated. For this to work, it would need to rotate the physical image file already uploaded to the server.

However, I imagine this is far beyond the scope of what 3Di envisaged when commencing this extension!

Re: [3.2][ALPHA] EXIR - Exif Image Rotation

Posted: Thu Jun 28, 2018 11:25 pm
by fagbutlil
May be some kind of rotate script that can fool the browser ?

maybe some thing like this https://stackoverflow.com/questions/167 ... javascript it has a demo.

Re: [3.2][ALPHA] EXIR - Exif Image Rotation

Posted: Thu Jun 28, 2018 11:26 pm
by 3Di
fagbutlil wrote:
Thu Jun 28, 2018 11:20 pm
Plain english then it did not rotate :lol: failed to work no workie.

I landed up taking a selfie for the sake of it.
You can decide whether to stay with your conviction or provide the necessary data for a test.
You could take those images from your camera, not manipulated by any software, and create an archive to download.

So I could test your truth.
3Di wrote:
Thu Jun 28, 2018 6:01 pm
This will work only with attachments, if those have any exif data 'orientation' that can be read.
Else no logic will be applied, like if the extension is not active.

Re: [3.2][ALPHA] EXIR - Exif Image Rotation

Posted: Thu Jun 28, 2018 11:39 pm
by 3Di
KYPREO wrote:
Thu Jun 28, 2018 11:23 pm
Otherwise there is something else going on. Perhaps the way Samsung 8 implements EXIF orientation data?

The ideal fix for this would be to have rotate icon next to attachments or inline attachments in the preview window, allowing the user to see the orientiation error and fix it in the post itself. This is the best fix IMO as it overcomes user error and allows users to go back and edit a post if they their attachment isn't properly rotated. For this to work, it would need to rotate the physical image file already uploaded to the server.

However, I imagine this is far beyond the scope of what 3Di envisaged when commencing this extension!
For those Samsung > 5 lovers I suggest to try to switch to PHP 7.2 or greater, and report.
The image posted in the second post of this topic has been taken from a Samsung s5 and it works so far.

The future of this project is to have an Ajaxed feature as the natural fallback, in case. Let me get in full touch with this first, with PHP.
No need to rotate the physical image already uploaded to the server, also because this extension uses an event which does the job before of that, where the image have to be posted/stored, still.

Thanks for your feedback. :) Appreciated.

Generally speaking instead, for those who like to post criticism not surrogate by specific facts, programming errors and so on ...
.. but instead face the stage with something like "does not work" ... well, I do not have time to waste with games of this type, we're serious about it.

Re: [3.2][ALPHA] EXIR - Exif Image Rotation

Posted: Thu Jun 28, 2018 11:44 pm
by 3Di
fagbutlil wrote:
Thu Jun 28, 2018 11:25 pm
May be some kind of rotate script that can fool the browser ?

maybe some thing like this https://stackoverflow.com/questions/167 ... javascript it has a demo.
I don't think so. :geek: How do you store the image with that? :)

If you speak code, you could take and fork the repo, do your stuffs with it and go ahead yourself.
It's free software, GPL'ed. ;)

Edit: have a read about Exif orientation: https://www.impulseadventure.com/photo/ ... ation.html

Re: [3.2][ALPHA] EXIR - Exif Image Rotation

Posted: Thu Jun 28, 2018 11:54 pm
by KYPREO
3Di wrote:
Thu Jun 28, 2018 11:39 pm
The future of this project is to have an Ajaxed feature as the natural fallback, in case. Let me get in full touch with this first, with PHP.
No need to rotate the physical image already uploaded to the server, also because this extension uses an event which does the job before of that, where the image have to be posted/stored, still.
This, I love! Well done and thanks.

I will give this a try on my board when I get a chance and provide feedback, although I am on php 7.1.7 currently.

Re: [3.2][ALPHA] EXIR - Exif Image Rotation

Posted: Thu Jun 28, 2018 11:59 pm
by 3Di
KYPREO wrote:
Thu Jun 28, 2018 11:54 pm
3Di wrote:
Thu Jun 28, 2018 11:39 pm
The future of this project is to have an Ajaxed feature as the natural fallback, in case. Let me get in full touch with this first, with PHP.
No need to rotate the physical image already uploaded to the server, also because this extension uses an event which does the job before of that, where the image have to be posted/stored, still.
This, I love! Well done and thanks.

I will give this a try on my board when I get a chance and provide feedback, although I am on php 7.1.7 currently.
I did tests with PHP 5.5.38 to 7.xx to 7.1.xx to 7.2.xx :) PHP 7.2 got some more exifs, a lot.

If you want, I allow you to PM me an archive of pictures (not manipulated) to use for my private tests, it doesn't matter the Phone/Exif.