Make WordPress Core


Ignore:
Timestamp:
06/21/2024 08:35:25 PM (8 months ago)
Author:
joedolson
Message:

Media: Fix implicit conversion from float to int in image cropping.

Cast crop values to integers to prevent PHP error caused by implicit conversion from float to int values when cropping images using ImageMagick.

Props skithund, mai21, nicomollet, amanias1977, joedolson.
Fixes #59782.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-attachments-controller.php

    r58447 r58457  
    23772377        $this->assertCount( 1, WP_Image_Editor_Mock::$spy['crop'] );
    23782378        $this->assertSame(
    2379             array( 320.0, 48.0, 64.0, 24.0 ),
     2379            array( 320, 48, 64, 24 ),
    23802380            WP_Image_Editor_Mock::$spy['crop'][0]
    23812381        );
Note: See TracChangeset for help on using the changeset viewer.