[wp-trac] [WordPress Trac] #54937: EXIF image orientation issue
WordPress Trac
noreply at wordpress.org
Wed Jan 26 22:47:39 UTC 2022
#54937: EXIF image orientation issue
-------------------------------------+---------------------
Reporter: tbember | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 6.0
Component: Media | Version: 5.3
Severity: normal | Resolution:
Keywords: has-patch needs-testing | Focuses:
-------------------------------------+---------------------
Changes (by SergeyBiryukov):
* version: 5.9 => 5.3
* milestone: Awaiting Review => 6.0
Old description:
> **Description:**
> Images with EXIF orientation flag can be displayed in wrong orientation.
>
> **Steps to reproduce:**
> Go to the WordPress Media Library screen and upload images 2, 4, 5, 7
> (either portrait or landscape) from the repo below - the images should
> display in wrong orientation.
>
> https://github.com/recurser/exif-orientation-examples
>
> **Cause:**
> On wp-includes/class-wp-image-editor.php, the function flip() is being
> called with swapped parameters.
>
> I presume there was probably some confusion around the meaning of $horz
> and $vert params. Rather than flipping the image horizontally and
> vertically, respectively, they actually flip the image along the
> horizontal and vertical axis, respectively, which is the complete
> opposite behavior. This subject has already been discussed on:
>
> https://core.trac.wordpress.org/ticket/23775
>
> **Proposed solution**
> Apply the attached patch.
New description:
**Description:**
Images with EXIF orientation flag can be displayed in wrong orientation.
**Steps to reproduce:**
Go to the WordPress Media Library screen and upload images 2, 4, 5, 7
(either portrait or landscape) from the repo below - the images should
display in wrong orientation.
https://github.com/recurser/exif-orientation-examples
**Cause:**
On wp-includes/class-wp-image-editor.php, the function flip() is being
called with swapped parameters.
I presume there was probably some confusion around the meaning of $horz
and $vert params. Rather than flipping the image horizontally and
vertically, respectively, they actually flip the image along the
horizontal and vertical axis, respectively, which is the complete opposite
behavior. This subject has already been discussed on: #23775.
**Proposed solution**
Apply the attached patch.
--
Comment:
Hi there, welcome to WordPress Trac! Thanks for the ticket and the patch.
The code in question was added in [46202] / #14459, changing the version
accordingly.
Moving to 6.0 for investigation.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/54937#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list