We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Progressive jpegs with Phalcon

Is it possible to save a progressive JPEG with Phalcon? Basically turn intelacing on. Couldn't find any mentions in official docs or on this forum. Thank you!

edited May '16

There's nothing specific in which PHP framework should implement those functionalities. Image processing is done either with GD or ImageMagick libs.

That’s right. However I wonder if Phalcon\Image\Adapter\Imagick can support it and if not, whether it is possible to somehow access the “image” php object that can be manipulated using plain old PHP functions. So I can do something like this:

$image = new Phalcon\Image\Adapter\Imagick("upload/test.jpg");

imageinterlace ($image, true);

You can use provided class functionalities: https://docs.phalcon.io/en/latest/api/Phalcon_Image_Adapter_Imagick.html

On top of that, you can use parent methods from native Imagick extension.



5.2k
Accepted
answer

Thanks! Got it working this way

$image->getImage()->setInterlaceScheme(\Imagick::INTERLACE_PLANE);

where $image is an instance of \Phalcon\Image\Adapter\Imagick