note 114758 added to function.imagecopyresampled
| From: | julien at go-on-web dot com | Date: | Wed, 02 Apr 2014 08:59:55 +0000 |
| Subject: | note 114758 added to function.imagecopyresampled | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-199103@lists.php.net to get a copy of this message | ||
Windows does not accept floating width and height...
So, in "Example #2 Resampling an image proportionally", prefer :
<?php
if ($width/$height > $ratio_orig) {
$width = round( $height*$ratio_orig );
} else {
$height = round( $width/$ratio_orig );
}
?>
(used "round")
otherwise your image wont be resized.
----
Server IP: 195.221.21.36
Probable Submitter: 109.190.5.144
----
Manual Page -- http://php.net/manual/en/function.imagecopyresampled.php
Edit -- https://master.php.net/note/edit/114758
Del: integrated -- https://master.php.net/note/delete/114758/integrated
Del: useless -- https://master.php.net/note/delete/114758/useless
Del: bad code -- https://master.php.net/note/delete/114758/bad+code
Del: spam -- https://master.php.net/note/delete/114758/spam
Del: non-english -- https://master.php.net/note/delete/114758/non-english
Del: in docs -- https://master.php.net/note/delete/114758/in+docs
Del: other reasons-- https://master.php.net/note/delete/114758
Reject -- https://master.php.net/note/reject/114758
Search -- https://master.php.net/manage/user-notes.php