Re: image uploading/resizing best practices in PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Option one is much better.

--
Shafiq Rehman (ZCE)
http://phpgurru.com | http://shafiq.pk

On 3/22/07, Tijnema ! <tijnema@xxxxxxxxx> wrote:

On 3/22/07, Dwayne Heronimo <dwayne@xxxxxxxxxxxxxxx> wrote:
> Dear All,
>
> I would like to make a script to upload a jpg filewith php to a server;
then
> make a thumb; save if for later use. And store the path to the image in
a
> database to display it later. But what is the best practice to do this
on a
> relatively low traffic website?
>
> I dont know where to begin but I have 2 appoaches:
>
> 1. To make a script to upload the image and resize this on the fly and
store
> only the thumb image somewhere for later use. While also to store the
image
> path in de database for later retrieval.

The best way i think if you have enough space on the server to store the
thumb.

>
> 2. to make a script to only upload the image as is and then insert the
image
> path in the database for later use. And upon displaying the image to use
> like a nondistructive <img scr="resizer.php?imgfile=image.jpg&width=250"
> border=0> resizer to display the image in the desired dimentions.
This one is worser then the first one, because everytime you request
the thumb would cost some CPU power. This isn't a lot, but if you are
gonna process 1000s thumbs a time, it will really make difference in
performance.

>
> Which one would be the best practice now a days for a relative low
traffic
> site?
> I really have no idean how to build this but I have a good approach I
maybe
> could start searching for something more specific.
>
> Thanks for your help,
>
> Dwayne
>
You should have a look at the image functions of
PHP(www.php.net/image). Creating the thumbs is the hardest part. The
upload part should be no problem with a little bit of google :)
Or you might want to google for a full working scripts, i saw them around.

Tijnema


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

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux