M
M
Michael2018-07-27 13:51:51
1C-Bitrix
Michael, 2018-07-27 13:51:51

How to optimize already uploaded images in Bitrix?

A large number of images for infoblocks have been uploaded to the site managed by Bitrix. The images are not optimized at all. In some places, almost originals are loaded, weighing several megabytes.
How can you remake images with normal parameters now? For example, maximum resolution, JPG compression level, etc.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2018-07-27
@idruweb

https://dev.1c-bitrix.ru/api_help/main/reference/c...
for bells and whistles - dig modules on the marketplace

D
dgrigory, 2018-07-27
@dgrigory

Iterate over all images starting from the /upload/iblock/ directory and recompress them using CFile::ResizeImageFile(). If there are a lot of pictures, then you need to do it step by step, otherwise there is a risk of getting too many open files.
There are also modules, for example https://marketplace.1c-bitrix.ru/solutions/dev2fun... Works with jpegoptim and optipng utilities recommended by google speed page. These utilities must be installed on the server, some hosts support them. Optimization parameters are configured in the admin panel and a button appears to optimize all existing images. Unfortunately, there is no maximum resolution in the settings. Well, then, everything newly loaded will also be passed in the background through optimizers.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question