[php-src] Issue #8848: imagecopyresized() error message refers to the wrong argument as problematic

From: Date: Thu, 23 Jun 2022 08:45:46 +0000
Subject: [php-src] Issue #8848: imagecopyresized() error message refers to the wrong argument as problematic
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-241787@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/8848 Author: ErikRoelofs ### Description The following code: ```php <?php $image1 = imagecreatetruecolor(1,1); $image2 = imagecreatetruecolor(1,1); imagecopyresized($image1, $image2, 1, 1, 1, 1, 0, 0, 1, 1); ``` Resulted in this output: ``` Uncaught ValueError: imagecopyresized(): Argument #3 ($dst_x) must be greater than 0 in php shell code:1 ``` But I expected this output instead: ``` Uncaught ValueError: imagecopyresized(): Argument #7 ($dst_width) must be greater than 0 in php shell code:1 ``` Note that the same applies to argument 8, if you set $dst_width to 1 but keep $dst_height at 0, then it says "Argument #4" instead of "Argument #8" in the error message. ### PHP Version 8.0.20 ### Operating System Ubuntu 20.04

« previous php.bugs (#241787) next »