note 126845 added to function.imagecopyresampled
| From: | mark at manngo dot net | Date: | Sat, 12 Feb 2022 07:57:55 +0000 |
| Subject: | note 126845 added to function.imagecopyresampled | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-217602@lists.php.net to get a copy of this message | ||
Note that as of PHP 8.1, you will get deprecated errors if the arguments are floating point. You
will save yourself a lot of angst if you cast the arguments:
<?php
imagecopyresampled(
$dst_image, $src_image,
(int) $dst_x, (int) $dst_y,
(int) $src_x, (int) $src_y,
(int) $dst_width, (int) $dst_height,
(int) $src_width, (int) $src_height
);
?>
You could also have rounded them off, but I think casting them is truer to the original behaviour.
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.5.135 (proxied: 159.196.219.235)
----
Manual Page -- https://php.net/manual/en/function.imagecopyresampled.php
Edit -- https://main.php.net/note/edit/126845
Del: integrated -- https://main.php.net/note/delete/126845/integrated
Del: useless -- https://main.php.net/note/delete/126845/useless
Del: bad code -- https://main.php.net/note/delete/126845/bad+code
Del: spam -- https://main.php.net/note/delete/126845/spam
Del: non-english -- https://main.php.net/note/delete/126845/non-english
Del: in docs -- https://main.php.net/note/delete/126845/in+docs
Del: other reasons-- https://main.php.net/note/delete/126845
Reject -- https://main.php.net/note/reject/126845
Search -- https://main.php.net/manage/user-notes.php