E
E
EvgMul2015-11-04 12:09:13
Yii
EvgMul, 2015-11-04 12:09:13

How to work with ImageHandler.php correctly?

Hello, a question for those who worked with this library, please tell me how to display an image on the screen after processing by the ImageHandler class?
I do it like this:

$image = new ImageHandler();
$image->load(Yii::getAlias('@webroot')."/files/1.jpg")->resize(100,100)->show();

A lot of characters, hieroglyphs, etc. are displayed on the screen. Please tell me where and what am I doing wrong? Thanks in advance to all who respond.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivanq, 2015-11-04
@EvgMul

Here's how to do it: create an additional image.php file, write it there

Header("Content-type: image/jpeg");
$image = new ImageHandler();
$image->load(Yii::getAlias('@webroot')."/files/1.jpg")->resize(100,100)->show();

Then in your file add<img src="image.php" alt="image.php">

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question