note 92638 added to function.imagejpeg
| From: | someone at anydomain dot com | Date: | Sat, 01 Aug 2009 20:20:50 +0000 |
| Subject: | note 92638 added to function.imagejpeg | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-158989@lists.php.net to get a copy of this message | ||
I am using the following function for creating thumbnail(s). it works fine. I just want all the
thumbnails a contant height so that they fit in a line. the only problem is that it can only output
one image to the browser only. how can it be used to output multiple images.
<?php
function resizeImage($originalImage,$new_height){
// Get the original geometry and calculate scales
list($width, $height) = getimagesize($originalImage);
$new_width = round(($width * $new_height) / $height);
// Resize the original image
$imageResized = imagecreatetruecolor($new_width, $new_height);
$imageTmp = imagecreatefromjpeg ($originalImage);
imagecopyresampled($imageResized, $imageTmp, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
// Output
imagejpeg($imageResized, null, 100);
imageDestroy($imageResized);
return;
}
resizeImage("IMG_0158.JPG",100); //this one shows on the browser
resizeImage("IMG_0159.JPG",100); //this one, and any subsequent ones, do not show up on
the browser
?>
----
Server IP: 209.41.74.194
Probable Submitter: 69.76.159.196
----
Manual Page -- http://www.php.net/manual/en/function.imagejpeg.php
Edit -- https://master.php.net/note/edit/92638
Del: integrated -- https://master.php.net/note/delete/92638/integrated
Del: useless -- https://master.php.net/note/delete/92638/useless
Del: bad code -- https://master.php.net/note/delete/92638/bad+code
Del: spam -- https://master.php.net/note/delete/92638/spam
Del: non-english -- https://master.php.net/note/delete/92638/non-english
Del: in docs -- https://master.php.net/note/delete/92638/in+docs
Del: other reasons-- https://master.php.net/note/delete/92638
Reject -- https://master.php.net/note/reject/92638
Search -- https://master.php.net/manage/user-notes.php