Y
Y
Yura Khlyan2018-09-06 18:46:28
Django
Yura Khlyan, 2018-09-06 18:46:28

How to reduce image size?

Good day.
I have two sites (one with a blog, the second - a store). The blog has an API in which I give information about the post: title, date and picture. I send the picture as an absolute url to the picture on the blog site.
The problem is this: the picture is of very good quality (2-4 MB each), and if I display 10 publications on the store’s website, then for each of them I need to display a picture. I don't want to upload 10 2 MB images at all.
How can I shrink pictures on the fly?
Thanks in advance for your reply.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Gornostaev, 2018-09-06
@MAGistr_MTM

Return the URL not of the original image, but of its pre-compressed version.

A
Alexey Skleinov, 2018-09-06
@lexskal

in any case, you need to resize images, your images should weigh several times less and not lose noticeably in quality. Resizer - a script that allows you to create images of a smaller (custom, if you want) size, it is possible to save them for reuse. They can be stored wherever you like. Sample scripts and implementations can be easily found on the web.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question