note 102353 added to function.getimagesize
| From: | falkon303 at gmail dot com | Date: | Thu, 10 Feb 2011 06:01:41 +0000 |
| Subject: | note 102353 added to function.getimagesize | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-176836@lists.php.net to get a copy of this message | ||
Here's a simple way to resize your images based on a percentage.
<?php
$image_path = "images/your_image.png";
list($width, $height, $type, $attr)= getimagesize($image_path);
//specify what percentage you are resizing to
$percent_resizing = 80;
$new_width = round((($percent_resizing/100)*$width));
$new_height = round((($percent_resizing/100)*$height));
echo '<img src="'.$image_path.'"
height="'.$new_height.'" width="'.$new_width.'">';
?>
----
Server IP: 69.147.83.197
Probable Submitter: 24.18.66.251
----
Manual Page -- http://www.php.net/manual/en/function.getimagesize.php
Edit -- https://master.php.net/note/edit/102353
Del: integrated -- https://master.php.net/note/delete/102353/integrated
Del: useless -- https://master.php.net/note/delete/102353/useless
Del: bad code -- https://master.php.net/note/delete/102353/bad+code
Del: spam -- https://master.php.net/note/delete/102353/spam
Del: non-english -- https://master.php.net/note/delete/102353/non-english
Del: in docs -- https://master.php.net/note/delete/102353/in+docs
Del: other reasons-- https://master.php.net/note/delete/102353
Reject -- https://master.php.net/note/reject/102353
Search -- https://master.php.net/manage/user-notes.php