I
I
Ivan Antonov2016-06-29 14:47:33
symfony
Ivan Antonov, 2016-06-29 14:47:33

How to resize an image on the fly and save it to a folder?

In a file project, I have a File entity. For some files, namely pictures, you need a small copy, so I created another field for it. BUT after some time there was a need to add another copy of the picture of a different size, but there is no desire to pollute the database with extra fields.
Recently working with CMS, I noticed that thumbnails are created and saved without the involvement of the database. After a little thought, I understood the principle of operation. When a user visits a page that should have a thumbnail, the server takes the image, shrinks it, and stores it in the cache folder for quick recall on future requests.
I assume that Symfony (3.0) already has a bundle for convenient image manipulation from Twig. Advise, please, a stable beam.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
BoShurik, 2016-06-29
@antonowano

https://github.com/liip/LiipImagineBundle

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question