[wp-trac] [WordPress Trac] #54937: EXIF image orientation issue

WordPress Trac noreply at wordpress.org
Wed Jan 26 21:30:31 UTC 2022


#54937: EXIF image orientation issue
--------------------------+-------------------------------------
 Reporter:  tbember       |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Media         |    Version:  5.9
 Severity:  normal        |   Keywords:  has-patch needs-testing
  Focuses:                |
--------------------------+-------------------------------------
 **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.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54937>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list