note 126844 added to function.imagecopyresampled
| From: | Anonymous at main dot php dot net | Date: | Sat, 12 Feb 2022 07:57:29 +0000 |
| Subject: | note 126844 added to function.imagecopyresampled | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-217601@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/126844
Del: integrated -- https://main.php.net/note/delete/126844/integrated
Del: useless -- https://main.php.net/note/delete/126844/useless
Del: bad code -- https://main.php.net/note/delete/126844/bad+code
Del: spam -- https://main.php.net/note/delete/126844/spam
Del: non-english -- https://main.php.net/note/delete/126844/non-english
Del: in docs -- https://main.php.net/note/delete/126844/in+docs
Del: other reasons-- https://main.php.net/note/delete/126844
Reject -- https://main.php.net/note/reject/126844
Search -- https://main.php.net/manage/user-notes.php