Welcome to WebmasterWorld Guest from 54.162.117.84

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Using PHP to create thumbnails of jpg on upload

     
6:49 pm on Jan 19, 2003 (gmt 0)

Administrator

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 24, 2001
posts:15755
votes: 0


Anyone done this? I was just looking around and seeing how it may be done and figured someone might have an idea.

I am looking at image functions as well as GD.

6:56 pm on Jan 19, 2003 (gmt 0)

Administrator

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 24, 2001
posts:15755
votes: 0


2 functions in particular I am looking at are

[php.net...]
and
[php.net...]

6:57 pm on Jan 19, 2003 (gmt 0)

Senior Member from GB 

WebmasterWorld Senior Member brotherhood_of_lan is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Jan 30, 2002
posts:4843
votes: 2


I have one here in a zip called "upnreload3.0", it creates thumbnails and puts them in one directory and optionally to resize the first image and put it in another folder.

Although I've not used it much the script does it very well ;) I have not managed to get time to play around with it and alter it to my liking

If you are looking for a pre-made script just for testers then you might want to look at something like this.

cant remember the site where i got it from, but i did find it through hotscrips

11:47 pm on Jan 19, 2003 (gmt 0)

Preferred Member

10+ Year Member

joined:Jan 5, 2003
posts:380
votes: 0


I use imagemagick ( .org ) to make thumbs, It' requires you use exec("/usr/bin/convert".$yourargs) to make the thumbs, and that it is installed on the server, but it creates very good quality thumbs. It is also extremely versatile, and can do what photohop can do ( within reason, e.g. resizing, croping, rotation, adjusting color, etc ), all from the commandline. It's open source too ;)
1:11 am on Jan 20, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Nov 25, 2000
posts:1786
votes: 0


>>>GD

When you say "resize" does this include reducing the filesize or is it merely reducing dimesion?

>>>>imagemagick

Is there a gui for using im on the server like a graphics program?

12:46 pm on Jan 21, 2003 (gmt 0)

Preferred Member

10+ Year Member

joined:Jan 5, 2003
posts:380
votes: 0


>>>GD

> When you say "resize" does this include reducing the filesize or is it merely reducing dimesion?

both. Imagemagick is a collection of programs, the one i use the most is convert.

it can convert from say gif to jpg, change the size ( in dimentions ) and you can set a quality setting if the output is jpeg.

When I'm talking about quality, i'm not talking about jpg "quality" but the quality of the resize (resampling) algorithum. I have seen sites that use GD and their thumbnails are all rough and low quality, wheres covert resizes an image as photoshop does, buy resampling useing complicated algos.

>>>>imagemagick

>Is there a gui for using im on the server like a graphics program?

it's a UNIX program, that will run on unix servers. There is a gui for it, but i'm not sure how you're supposed to control a GUI from a php script ;)

ok i found a site that compates the quality between GD and netPBM ( although not imagemagick, imagemagick is as good as if not better than netPBM )
[vddh.com...]