note 41619 added to function.imagecopyresampled

From: Date: Fri, 16 Apr 2004 20:08:24 +0000
Subject: note 41619 added to function.imagecopyresampled
Groups: php.notes 
Request: Send a blank email to php-notes+get-68225@lists.php.net to get a copy of this message
another scale size calculation function that figures out how to best stuff a big image into a little space or vise versa. <?php function CalcScrunchSize($CurH,$CurW,$MaxH,$MaxW) //calculates how to stuff a big img into a lil space { $HRatio = $CurH/$maxH; $WRatio = $CurW/$MaxW; if($HRatio > $WRatio) { $result[0] = $CurW*($MaxH/$CurH); $result[1] = $MaxH; } else { $result[0] = $MaxW; $result[1] = $CurH*($MaxW/$CurW); } return($result); } ?> ---- Manual Page -- http://www.php.net/manual/en/function.imagecopyresampled.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+41619 Delete -- http://master.php.net/manage/user-notes.php?action=delete+41619&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+41619&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#68225) next »