开发者

Which function to use for thumbnail creation imagecopyresampled() or imagecopyresized()?

开发者 https://www.devze.com 2023-03-31 14:19 出处:网络
i\'m building a image uploading functionality in my website which g开发者_Go百科ives users the possibility to upload a picture of any size to the website. This picture gets automatically resized to a

i'm building a image uploading functionality in my website which g开发者_Go百科ives users the possibility to upload a picture of any size to the website. This picture gets automatically resized to a thumbnail size. I've browsed around for some code and i see some using the imagecopyresampled() function to resize and some the imagecopyresized(). Which one is the best to use? What are the differences?


imagecopyresized() copies a rectangular portion of one image to another image. dst_image is the destination image, src_image is the source image identifier.

imagecopyresampled() copies a rectangular portion of one image to another image, smoothly interpolating pixel values so that, in particular, reducing the size of an image still retains a great deal of clarity.

php.net is your friend

That seemed overly snarky. Sorry about that. Personally I always use imagecopyresampled()

0

精彩评论

暂无评论...
验证码 换一张
取 消