Best way to cache resized images using PHP and MySQL

前端 未结 9 1571
庸人自扰
庸人自扰 2020-12-22 23:54

What would be the best practice way to handle the caching of images using PHP.

The filename is currently stored in a MySQL database which is renamed to a GUID on upl

9条回答
  •  清酒与你
    2020-12-23 00:43

    phpThumb is a framework that generates resized images/thumbnails on the fly. It also implements caching and it's very easy to implement.

    The code to resize an image is:

    thumbnail
    

    will give you a thumbnail of 200 x 200;

    It also supports watermarking.

    Check it out at: http://phpthumb.sourceforge.net/

提交回复
热议问题