【发布时间】:2023-03-18 18:35:01
【问题描述】:
我正在设计一个页面,其中每张上传的图片都包含不同的图片尺寸。
For example an image can be:
original: whatever a user uploads
large: 718x405
medium: 344x194
small: 125x70
square: 238x238
过去,在 mysql 中,我只有名为 image_id、image_name 的字段,然后在代码中我会引用这些图像的位置:
Example from my past:
/images/gallery/large/some_image.jpg
/images/gallery/square/some_image.jpg
我见过其他系统做这样的事情:
/images/gallery/some_image-718x405.jpg
/images/gallery/some_image-238x238.jpg
除了将图像放在自己的表中的基本思想之外,还有哪些为图像创建数据库的最佳做法。当您处理同一张图片的多种尺寸时,我会要求更多。
谢谢!
【问题讨论】: