S
S
Sunnat Abdukhalilov2019-04-16 09:41:13
Yii
Sunnat Abdukhalilov, 2019-04-16 09:41:13

How to crop images before uploading to server in yii2?

There is a form with connected YII2-Images, connected cropping of pictures after loading.
Found that when loading several images, it eats up all the RAM on the hosting.
Google found that you can change the server settings, now it loads without error but for a very long time. The task of cropping and compressing pictures (not just one) even before uploading
to the server, can be done according to the
standard

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2019-04-23
@webinar

The task is to crop and compress pictures (not just one) before uploading to the server

Everything before uploading to the server is about js, which means we formulate the right question for Google: js crop image
often the issue is solved by changing the GD library to imagick Surprise how much less resources it eats when cropping, especially in the case of png. Often it is already on the server and you just need to change it in your library config, for example for CostaRico/yii2-images:
I quote the doc:
'graphicsLibrary' => 'GD', //but really its better to use 'Imagick'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question