Kullanıcıların giriş onların görüntüleri, onların çizimin boyutu vardır. Ben belirli bir boyutun tüm görüntüleri yeniden boyutlandırmak mümkün olmak istiyorum. Bana PHP bunu sağlayan bir işlevi var mı?
teşekkürler
The function you need is imagecopyresampled, that also interpolate pixels, (imagecopyresized does not);
In my code I use a it in a function like this:
function resizeAndSavePhoto($original, $destination, $dest_width, $dest_height){
$photo = createImage($original);
$size = getimagesize($original);
$final_photo = imagecreatetruecolor($dest_width, $dest_height);
imagecopyresampled($final_photo, $photo,0,0,0,0,$dest_width, $dest_height, $size[0], $size[1]);
imagejpeg($final_photo, $destination, 100);
}
$orignal ve $destination dosya yolları vardır
Özel olarak http://php.net/imagecopyresized
Tamam bir şey yapabilirsiniz:
http://net.tutsplus.com/tutorials/php/image-resizing-made-easy-with-php/
ya da zaten yapılan bir şey kullanmak, ben bu birini kullanın:
http://www.white-hat-web-design.co.uk/articles/php-image-resizing.php which works a treat