uisneach Posted February 27, 2009 Share Posted February 27, 2009 hello e.b. i got a issue with resizing script, the following i think all the parameters are correcet with this i got a fixe image very good as quality but i can only resize horizonatal pics list($width, $height, $type, $attr) = getimagesize($_SERVER['DOCUMENT_ROOT'].'public/foto/'.$ultimo_id.'.jpg'); // Creo la versione 120*90 dell'immagine (thumbnail) $thumb = imagecreatetruecolor(120, 90); $source = imagecreatefromjpeg($_SERVER['DOCUMENT_ROOT'].'public/foto/'.$ultimo_id.'.jpg'); imagecopyresized($thumb, $source, 0, 0, 0, 0, 120, 90, $width, $height); // Salvo l'immagine ridimensionata imagejpeg($thumb, $_SERVER['DOCUMENT_ROOT']."public/foto/thumbnail/".$ultimo_id."_thumb.jpg", 75); WHIT THIS ONE, I GOT A RESIZE WRONG , NOT AS I WISH (100PIX VERTICAL) and with very bad quality for the images with height higher than width (vertical, of course) don't understand a.. ??? $imagehw=(list($width, $height,$attr,$type) = getimagesize("public/foto/".$ultimo_id.".jpg")); $height = 100; $width = (int)(($imagehw[0]*100)/$imagehw[1]); $thumb = imagecreatetruecolor($width,$height); $source = imagecreatefromjpeg($_SERVER['DOCUMENT_ROOT'].'public/foto/'.$ultimo_id.'.jpg'); imagecopyresized($thumb, $source,0,0,0,0, $width, $height,$imagehw[0], $imagehw[1]); imagejpeg($thumb, $_SERVER['DOCUMENT_ROOT'].'public/foto/thumbnail/'.$ultimo_id.'_thumb.jpg',100); anyone has a clue? thanks in advance. paolo Link to comment https://forums.phpfreaks.com/topic/147184-resize-wrongly-with-bad-quality/ Share on other sites More sharing options...
uisneach Posted February 27, 2009 Author Share Posted February 27, 2009 sorry, it's ok now. Just need to tak out the width parameter in div.boxpicture class! ;D it's really a stupid thing, sorry. Link to comment https://forums.phpfreaks.com/topic/147184-resize-wrongly-with-bad-quality/#findComment-772752 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.