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

How to change image format/extension?

Is it possible to change format/extension of file using Adapter/Imagick or Adapter/Gd? I want to convert .png to .jpg, but I don't see such function in Phalcon docs? Do I need execute that with poor Imagick functions?



77.7k
Accepted
answer
edited Sep '15

https://docs.phalcon.io/en/latest/api/Phalcon_Image_Adapter.html

render($ext, $quality) you can set it manually with $ext

save($file, $quality) format is automatically determined from filename

https://github.com/phalcon/cphalcon/blob/2.0.x/phalcon/image/adapter/imagick.zep#L631