[wp-trac] [WordPress Trac] #55290: Not all image edits are applied to all subsizes

WordPress Trac noreply at wordpress.org
Tue Mar 8 00:02:27 UTC 2022


#55290: Not all image edits are applied to all subsizes
--------------------------+------------------------------------------
 Reporter:  mitogh        |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Future Release
Component:  Media         |     Version:  5.9.1
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  administration, performance
--------------------------+------------------------------------------
Changes (by mitogh):

 * keywords:  needs-patch => has-patch


Comment:

 I've added a patch with a suggested fix. The suggested fix follows the
 same approach as WordPress follows when the image is uploaded for the
 first time, this approach is basically that when an uploaded image is
 smaller in dimensions than an image size the image size is not created for
 the image, which was the case for this image when the image Was rotated it
 was smaller in dimensions that the failed size creating an error and not
 saving the edit.

 As described this approach would not save any image that was errored out
 by the editors, images would remain in the backup sizes and can be
 restored at any point in time, by rolling back an existing size.

 The function `wp_get_additional_image_sizes` was replaced with
 `wp_get_registered_image_subsizes`  in order to have a more accurate
 access to the defined image sizes by the user.

 Cast of values to `int` was introduced as well in order to make sure
 settings (as strings) were converted to integers.

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


More information about the wp-trac mailing list