How to save images when multiple sizes are needed?

What is the best way to store images? Currently, when an image is loading, I resize it to 3 different sizes (thumbnail, normal size and large size). I save the image description, format in the database and use the identifier number from the database as the image name. Each image size has its own catalog.

Should I store images in a database? Should I only store large size and generate a sketch as needed? Or any other ideas you have?

+3
source share
3 answers

What you described sounds reasonable to me. You can store images in your database, but you will not notice any significant performance improvements, and if your web host limits the size of your MySQL database, you may find that you are overpaying for database space.

, , ; , ( img src, width/height), - , ( ).

+2

, SQL ( HDD). " " , .

, / .

+2

If you have a drupal based site, this feature is built into http://drupal.org/project/imagecache

0
source

Source: https://habr.com/ru/post/1747791/


All Articles