yii2 imagine - image resize generates random rectangles


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);


Sample 2:

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

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



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