Search code examples
phpgd2

PHP + GD2: How can change resolution of image?


I'm using gd2 lib to work with images. I need to change resolution of image, still I cant find a method for that in a list of methods. How that can be done?

Thank you in advance


Solution

  • Use imagecopyresampled:

    imagecopyresampled($resizedImg, $srcImg, 0, 0, 0, 0, $resizeWidth, $resizeHeight, $srcWidth, $srcHeight)