[wp-trac] [WordPress Trac] #55070: Image Editing Cropping is not working properly

WordPress Trac noreply at wordpress.org
Mon Feb 6 23:23:34 UTC 2023


#55070: Image Editing Cropping is not working properly
-------------------------------------------------+-------------------------
 Reporter:  andy786                              |       Owner:
                                                 |  adamsilverstein
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  6.2
Component:  Media                                |     Version:  5.9
 Severity:  critical                             |  Resolution:
 Keywords:  has-patch has-screenshots has-       |     Focuses:
  testing-info reporter-feedback                 |
-------------------------------------------------+-------------------------

Comment (by antonvlasenko):

 So, this issue can be fixed by replacing
 `$meta['sizes'] = array_merge( $meta['sizes'], $img->multi_resize( $_sizes
 ) );`
 with
 `$meta['sizes'] = $img->multi_resize( $_sizes ) );`
 in `src/wp-admin/includes/image-edit.php`.
 But it's impossible to fix it this way because of
 https://core.trac.wordpress.org/ticket/22985.
 It will break BC.
 I've approved your PR, @adamsilverstein.
 I will add my test report soon.

 @sanketchodavadiya
 > Also, while cropping when make_subsize(...) > _resize(...) or
 resize(...) function run it throws WP_Error error_getting_dimensions.
 IMO this is fine, as `image_resize_dimensions()` cannot calculate
 dimensions for a resized image if it's smaller than the original image.

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


More information about the wp-trac mailing list