A
A
an5432019-03-11 13:26:27
Data storage
an543, 2019-03-11 13:26:27

How to save and display thumbnails for a site?

Good day to all, I want to save only the path to the main image in the database, then resize and save the thumbnail with the -thumbs.jpg prefix in the folder with the main image, how to display the thumbnail correctly? Keeping the original filename without the extension and then adding -thumbs.jpg is not a very good idea, or what are the options for saving and displaying thumbnails.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex, 2019-03-11
@an543

Keep the file name, Only the file name or a relative path can be used. Only not absolute, because it can change.
And name the files whatever you like.
Let 's say
Names don't matter. Depends on your algorithm.
WordPress for example names files like this
uploads/origin-800x600.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question