With Yii framework 2.0, I want to use the Imagine Extension for Yii 2. After the documentation, I first run the following command line.
php composer.phar require --prefer-dist yiisoft/yii2-imagine "*"
After running the above command line, I could see that the imag package appeared in the vendor directory. In my views of /site/index.php, I included the following code snippet.
use yii\imagine\Image;
Image::thumbnail('@webroot/img/test-image.jpg', 120, 120)
->save(Yii::getAlias('@runtime/thumb-test-image.jpg'), ['quality' => 50]);
Below is the result:
PNG IHDRxx9d6 pHYs + IDATx y eW} 9w o o ZJ 6 1`c D n L 8㈞G c{ r ƀ$ R{UVV [ {w?g x / ʪJUI ; = l
No image. I do not know what I missed, the image path is correct. Does anyone know how to solve it? thank
source
share