note 67303 added to function.imagecopyresized
| From: | GuilhermeValéroVeras at osu1 dot php dot net | Date: | Wed, 07 Jun 2006 05:26:30 +0000 |
| Subject: | note 67303 added to function.imagecopyresized | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-113429@lists.php.net to get a copy of this message | ||
Criando um simples thumb com o tamanho que você quiser!
Algo mais objetivo:
<?php
$filename = 'nome_sua_img.jpg';
$TamX = 106; // Novo Tamanho para X
$TamY = 73; // Novo Tamanho para Y
header('Content-type: image/jpeg');
// Obtendo os tamanhos
list($width, $height) = getimagesize($filename);
// Alocando o thumb
$thumb = imagecreatetruecolor($TamX , $TamY);
$source = imagecreatefromjpeg($filename);
// Mudando o tamanho 106 x 73 - Gerando o Thumb em sÃ
imagecopyresized($thumb, $source, 0, 0, 0, 0, $TamX , $TamY, $width, $height);
// Imprimindo no Browser
imagejpeg($thumb);
// Liberando a memoria
imagedestroy($thumb);
?>
=)
----
Server IP: 66.163.161.117
Probable Submitter: 201.62.128.45
----
X-Spam-Status: Yes, hits=7.4 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER,
HEAD_ILLEGAL_CHARS autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.imagecopyresized.php
Edit -- http://master.php.net/note/edit/67303
Del: integrated -- http://master.php.net/note/delete/67303/integrated
Del: useless -- http://master.php.net/note/delete/67303/useless
Del: bad code -- http://master.php.net/note/delete/67303/bad+code
Del: spam -- http://master.php.net/note/delete/67303/spam
Del: non-english -- http://master.php.net/note/delete/67303/non-english
Del: in docs -- http://master.php.net/note/delete/67303/in+docs
Del: other reasons-- http://master.php.net/note/delete/67303
Reject -- http://master.php.net/note/reject/67303
Search -- http://master.php.net/manage/user-notes.php