note 100516 added to function.imagecopyresampled
| From: | me at 3000farad dot com | Date: | Thu, 21 Oct 2010 00:37:08 +0000 |
| Subject: | note 100516 added to function.imagecopyresampled | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-173325@lists.php.net to get a copy of this message | ||
<?php
if (($originalHeight/$maxHeight) > ($originalWidth/$maxWidth)) { // The height is the
independent factor, width is dependent
$finalHeight = min($originalHeight,$maxHeight); // Doesn't change the size if it's under
the max (prevents enlargement)
$finalWidth = round($originalWidth*($finalHeight/$originalHeight));
}
else { // The width is independent, or it doesn't matter (the aspect ratio of the original and
the max are the same)
$finalWidth = min($originalWidth,$maxWidth);
$finalHeight = round($originalHeight*($finalWidth/$originalWidth));
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 216.160.144.169
----
Manual Page -- http://www.php.net/manual/en/function.imagecopyresampled.php
Edit -- https://master.php.net/note/edit/100516
Del: integrated -- https://master.php.net/note/delete/100516/integrated
Del: useless -- https://master.php.net/note/delete/100516/useless
Del: bad code -- https://master.php.net/note/delete/100516/bad+code
Del: spam -- https://master.php.net/note/delete/100516/spam
Del: non-english -- https://master.php.net/note/delete/100516/non-english
Del: in docs -- https://master.php.net/note/delete/100516/in+docs
Del: other reasons-- https://master.php.net/note/delete/100516
Reject -- https://master.php.net/note/reject/100516
Search -- https://master.php.net/manage/user-notes.php