You are here: Re: Resize an image stored in a DB prior to diplaying it on page « PHP Programming Language « IT news, forums, messages
Re: Resize an image stored in a DB prior to diplaying it on page

Posted by NC on 09/21/05 18:31

bissatch@yahoo.co.uk wrote:
>
> I need to be able to resize it to a thumbnail image
> prior to outputting. How would I do this?

The easy answer is that you probably shouldn't do it at all.
Image resizing is a CPU-intensive process, so resizing should
be done once, when uploading the image to the server. The
resulting thumbnail would then be stored next to the full-size
image.

Also, the wisdom of storing images in databases is questionable.
If you have a PHP page with five images on it, every time someone
views it, six simultaneous connections to the database will be
opened.

For details on resizing, see documentation for imagecopyresized()
and imagecopyresampled() functions:

http://www.php.net/imagecopyresized
http://www.php.net/imagecopyresampled

Cheers,
NC

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация