Phpthumbof forcefully resizes small images

127 views Asked by At

If I give phpthumbof an image with size of 78x78 and give these parameters: w=283&h=248&f=png&zc=1 it returns pixelated upresized image.

Source image: http://srv39820.ht-test.ru/28-5.icon-vk.png

Result image: http://srv39820.ht-test.ru/28-5.icon-vk_283x248_3c1.png

This problem came up after moving to other hosting. On previous one the result image was equal to source image.

1

There are 1 answers

2
Dexa On

You should check image size before resizing.

list($width, $height) = getimagesize($source);  

now if width and height are smaller then required, don't resize and just save your image.