note 94933 added to function.getimagesize
| From: | swapnil dot nkene at gmail dot com | Date: | Thu, 03 Dec 2009 10:08:55 +0000 |
| Subject: | note 94933 added to function.getimagesize | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-163522@lists.php.net to get a copy of this message | ||
A simplest method to resize a image keeping the constraint proportions.
list($width, $height, $type, $attr)=getimagesize($imagepath);
$ht=$height;
$wd=$width;
if($width>180){
$diff = $width-180;
$percnt_reduced = (($diff/$width)*100);
$ht = $height-(($percnt_reduced*$height)/100);
$wd= $width-$diff;
}
if($height>180){
$diff = $height-180;
$percnt_reduced = (($diff/$height)*100);
$wd = $width-(($percnt_reduced*$width)/100);
$ht= $height-$diff;
}
----
Server IP: 69.147.83.197
Probable Submitter: 114.143.8.118
----
Manual Page -- http://www.php.net/manual/en/function.getimagesize.php
Edit -- https://master.php.net/note/edit/94933
Del: integrated -- https://master.php.net/note/delete/94933/integrated
Del: useless -- https://master.php.net/note/delete/94933/useless
Del: bad code -- https://master.php.net/note/delete/94933/bad+code
Del: spam -- https://master.php.net/note/delete/94933/spam
Del: non-english -- https://master.php.net/note/delete/94933/non-english
Del: in docs -- https://master.php.net/note/delete/94933/in+docs
Del: other reasons-- https://master.php.net/note/delete/94933
Reject -- https://master.php.net/note/reject/94933
Search -- https://master.php.net/manage/user-notes.php