Which function to use for imagecopyresampled () or imagecopyresized () thumbnails?

I am creating an image upload function on my website that gives users the ability to upload an image of any size to any website. This image is automatically resized to the thumbnail size. I was looking at the code for some code, and some of them use the imagecopyresampled () function to resize and some imagecopyresized (). Which one is best to use? What are the differences?

+4
source share
1 answer

imagecopyresized () copies the rectangular portion of one image to another image. dst_image is the target image, src_image is the identifier of the original image.

imagecopyresampled () copies the rectangular portion of one image onto another image, smoothly interpolating the pixel values, so, in particular, reducing the image size still retains greater clarity.

php.net is your friend

It seemed too ridiculous. Sorry about that. Personally, I always use imagecopyresampled ()

+4
source

Source: https://habr.com/ru/post/1369666/


All Articles