M
M
morricone852017-06-03 22:18:32
Yii
morricone85, 2017-06-03 22:18:32

Creating thumbnails in Yii2?

When adding a page, I load an image. Now the questions are:
1) How many miniatures do you make?
2) What is the size of the thumbnails?
3) Is there any extension in Yii2 for this?
4) Is it worth keeping the paths to thumbnails in the database?
Thank you.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dmitry, 2017-06-03
@slo_nik

Good evening.
1) As much as you want
2) Whatever you want
3) Yes, this is it
4) Yes

A
AlikDex, 2017-06-04
@AlikDex

1) in different ways, depending on the task. Sometimes 1 is enough, sometimes 4 is needed (on the main news list, for a widget, a thumbnail in the news itself and for mobile phones)
2) Based on the layout. but mostly from 180 in width to 320. sometimes less.
3) I don’t know, usually myself
4) I usually keep a link to the original, and I substitute miniatures from it.
Point 4:
In the database, something like /short/path/image1.jpg is a short link to the original.
on the server it is in the folder /var/www/blabla/site.com/uploads/images/src/short/path/image1.jpg
and the thumbnails are respectively:
on the server it is in the folder /var/www/blabla/site.com/uploads /images/240x180/short/path/image1.jpg

M
Maxim Timofeev, 2017-06-04
@webinar

1) Depends on the entity and the project
2) Depends on the entity and the project
3) Or this or that + its behavior, which is connected to the model and there is all the logic.
4) I only store filenames, thumbnails in folders named after thumbnail size, like 400x or 100x100 or x200

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question