[wp-trac] [WordPress Trac] #14459: Rotate Full Size Images on Upload
WordPress Trac
noreply at wordpress.org
Thu Oct 8 01:50:50 UTC 2015
#14459: Rotate Full Size Images on Upload
-------------------------------------------+-----------------------------
Reporter: mrroundhill | Owner: azaozz
Type: enhancement | Status: reviewing
Priority: normal | Milestone: Future Release
Component: Upload | Version: 3.0
Severity: normal | Resolution:
Keywords: needs-patch westi-like mobile | Focuses:
-------------------------------------------+-----------------------------
Comment (by msaggiorato):
Back when I posted my patch (which half solved the issue), I kept working
on this issue. And came to realize that the GD library is not the best way
to solve this issue as there are much more things in place than just the
EXIF rotation change.
After a bunch of research about the binary format of JPEG files, i came
across this library [https://github.com/lsolesen/pel].
With the help of this library, i was able to extract most of the EXIF data
from one image, and put it into the corrected image generated by the GD
library (that has no EXIF data, or color profile, or any other
information).
I also went a bit further and even fixed the thumbnail of the PNG (as it
may be required, and it also should be consistent with the full image).
In the end, I managed to make this work at a decent level. But didn't post
back the solution here because it involved too much server work and image
data binary manipulation, that shouldn't happen if browsers did their job
nicely.
I also thought that a solution like the one I implemented wouldn't be
totally approved by the community.
I'll try to put together a GitHub gist with my solution as it is now if
someone's interested.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/14459#comment:32>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list