On Sun, 2007-04-29 at 18:15 +0200, Alain Roger wrote:
> Hi,
> 
> I would like to know how i can display small sized picture in my web
> application ?
> I mean in my database, picture can have max. 500 Kb, however as on 1 PHP
> page i will display 20 pictures at once, i do not want to force end users to
> download all 20 pictures (10Mb around) to have an overview.
> 
> I would like directly on server to resize picture to display them to end
> user in format 100px*120px (for example) and like that size should be around
> 20 or 50Kb per picture.
> I was thinking to use imagecopyresized function for that, but will it no
> kill the server CPU and RAM ?
> 
> If you have some other suggestion, they are welcome, but do not forget that
> i must have pictures in Database and 500 Kb (due to picture printing later
> on - so good enough quality).

Create the thumbnail once and cache it. On subsequent requests check if
thumbnail exists, if so use the cache. If not build from original image.
This way you incur the heavy CPU hit once for each image requested. This
take more disk space though, but not terribly.

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to