yii2 imagine - image resize generates random rectangles

Hi,

I’m using the extension “yiisoft/yii2-imagine”: “~2.0.0”

And for some reason I’m getting random blocks on my image.

The code I used:

Sample 1:




$img = \yii\imagine\Image::thumbnail($image->tempName, 500, 500);

$img->show('jpg');



Sample 2:




$img = \yii\imagine\Image::getImagine();

$img = $img->open($image->tempName);

$img->resize($img->getSize()->widen(500));

$img->show('jpg');



The only thing I want to do is to resize the image (but keep aspect ratio) before saving.

Sample result can be found at: image.prntscr.com/image/bc80a6b1759741a59c2920e9c2d0f36f.png

For some weird reason it’s fixed …

I didn’t change anything