[wp-trac] [WordPress Trac] #48202: Media: rotation of JPEG files may fail

WordPress Trac noreply at wordpress.org
Thu Oct 3 15:29:38 UTC 2019


#48202: Media: rotation of JPEG files may fail
--------------------------+---------------------
 Reporter:  azaozz        |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  high          |   Milestone:  5.3
Component:  Media         |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+---------------------

Comment (by azaozz):

 Thanks for the bug report!

 Yes, the `rotate()` function in `WP_Image_Editor_GD` needs updating.

 - JPEGs don't support transparency so there's no need to do
 `imagealphablending()` and `imagesavealpha()` for them (the latter is only
 needed for PNGs).

 - The 4th param for `imagerotate()` is silently ignored since PHP 5.5, see
 https://www.php.net/manual/en/function.imagerotate.php.

 However testing the current code with several different JPEG images in PHP
 7.3.2 with GD version `bundled (2.1.0 compatible)` seems to work as
 expected.

 I'll make a patch. Would be great if you can confirm it works as expected.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/48202#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list