|
Posted by NC on 07/07/06 15:31
nickwired wrote:
>
> I have a few images users uploaded to a mySQL database.
> How can I out them as thumbnails.
Get the image from the database and use imagecopyresampled() to reduce
it.
http://www.php.net/imagecopyresampled
Additionally, consider storing thumbnails in the database along with
original images. Generating thumbnails dynamically is expensive in
terms of CPU usage. Many applications generate thumbnails as a part of
image upload procedure.
While you are in the considering mode, consider not storing images in
the database at all. Since not all browsers out there support <img
data="*"> tag, you need a separate script (and, hence, a separate
database connection) to render each image. So a page with five images
on it would create six database connections, which could have dire
performance consequences for a high-traffic Web site.
Cheers,
NC
Navigation:
[Reply to this message]
|