A
A
akula222018-03-14 09:41:10
Yii
akula22, 2018-03-14 09:41:10

How can I convert any images to jpg when uploading them to the site?

How can I convert all of them to jpg when uploading any pictures to the site (png, gif, etc.)?
at the moment I use the regular lib yii \ imagine \ Image
The problem is that if you upload, for example, png 1 mb, it compresses up to 500 kb, and I need less than 100 kb,
I make the size 500px wide
, I can’t find the right library.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis, 2018-03-14
@akula22

did not try to control the image quality

->save('path/to/destination/image.jpg', ['jpeg_quality' => 50]);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question