note 18167 added to function.imagecopyresized
| From: | william at waw dot com dot br | Date: | Sat, 12 Jan 2002 19:55:40 +0000 |
| Subject: | note 18167 added to function.imagecopyresized | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-24753@lists.php.net to get a copy of this message | ||
REDEFINE? BICUBIC? ARGH!
If you aren't happy with the quality of the resized images, just use this:
<?
// Cria thumbnail de uma imagem, com boa qualidade
// -----------------------------------------------
// William G. Comnisky
// william@waw.com.br
$imagem = "img.jpg";
$img_origem = imagecreatefromjpeg($imagem);
$nova_largura = imagesx($img_origem) / 4;
$nova_altura = imagesy($img_origem) / 4;
$img_destino = imagecreatetruecolor($nova_largura,$nova_altura);
imagecopyresampled($img_destino,
$img_origem,0,0,0,0,$nova_largura,$nova_altura,imagesx
($img_origem),imagesy($img_origem));
imageJPEG($img_destino);
?>
--
http://www.php.net/manual/en/function.imagecopyresized.php
http://master.php.net/manage/user-notes.php?action=edit+18167
http://master.php.net/manage/user-notes.php?action=delete+18167
http://master.php.net/manage/user-notes.php?action=reject+18167