thumb do thumb
pessoal do gerando um thumb na minha página até ae funciona ok!
dae eu salvo esse thumb gerado na minha maquina e tento dar um upload nele, e ele naum funciona, vai a imagem mais fica com peso 0.
alguem tem alguma luz?
esse eh o script de thumb
PHP
function geraThumb_($photo, $output, $new_width, $new_height){
$source = imagecreatefromstring([file_get_contents](http://br.php.net/file_get_contents)($photo));
list($width, $height) = [getimagesize](http://br.php.net/getimagesize)($photo);
if($width > $height){
if ($width>$new_width) {
$new_height = ($new_width/$width) * $height;
$thumb = imagecreatetruecolor($new_width, $new_height);
imagecopyresampled($thumb, $source, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
imagejpeg($thumb, $output, 100);
} else {
[copy](http://br.php.net/copy)($photo, $output);
}
} else {
if ($height>$new_height) {
$new_width = ($new_height/$height) * $width;
$thumb = imagecreatetruecolor($new_width, $new_height);
imagecopyresampled($thumb, $source, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
imagejpeg($thumb, $output, 100);
} else {
[copy](http://br.php.net/copy)($photo, $output);
}
}
}
tem alguns tipos de jpg tb q naum funcionam, mais naum consigo estabelecer uma regra pra saber... a unica confirmação eh q jog´s gerados pelo php conceretza naum funcionam
abraços!
Discussão (2)
Carregando comentários...