note 30913 added to ref.image
| From: | Angus at rack1 dot php dot net | Date: | Thu, 03 Apr 2003 04:40:41 +0000 |
| Subject: | note 30913 added to ref.image | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-46151@lists.php.net to get a copy of this message | ||
this code work faster in my p4 2G machine PHP Version 4.3.1 imageresampled() gives better quality
however much slower when work on high resolution image , e.g. the DC photo.therefore i first use
imageresized() to produce a middle size temp image, then imageresampled() the temp image to a
smaller thumbnail and output to the browser
<?php
$t_w = 444; // temp image width x 3
$t_h = 333; // temp image height x 3
................
// get and create intermediate image
................
imagecopyresized ($destimage,$srcimage,0,0,0,0,$t_w,$t_h,$width,$height);
// process of the output thumbnail
$t_w2 = round($t_w/3); //148
$t_h2 = round($t_h/3); //111
$destimage2 = imagecreatetruecolor($t_w2,$t_h2); // for output
imagecopyresampled ($destimage2,$destimage,0,0,0,0,$t_w2,$t_h2,$t_w,$t_h);
imagedestroy($destimage);
imageinterlace ($destimage2,1);//progressive jpeg
imagejpeg($destimage2, '', 45);
imagedestroy($destimage2);
.................
?>
--
http://www.php.net/manual/en/ref.image.php
http://master.php.net/manage/user-notes.php?action=edit+30913
http://master.php.net/manage/user-notes.php?action=delete+30913
http://master.php.net/manage/user-notes.php?action=reject+30913