View Full Version : Making Thumbnails
07-23-2007, 01:29 PM
i know how to move and upload photos great, but im not sure how to create a thumbnail say 100x100 of the same photo, i have checked a few tutorials out nothin i can get to grips with, can anyone give some advice or help on this.
07-23-2007, 01:43 PM
search this forum, answered 100's of times :D
Yep, this is a common requirement!
Check out the PHP image functions: http://uk3.php.net/manual/en/ref.image.php
And this one in particular:
http://uk3.php.net/manual/en/function.imagecopyresampled.php (Big hint ... use this function! :D ).
Note that you need to have the GD library compiled with your PHP build and that not all these functions will work with verisons of the library prior to GD 2.0. (Infact the earlier versions of GD are pretty clunky, IMHO).
07-23-2007, 02:30 PM
look at this post
07-23-2007, 06:06 PM
Thanks a lot for the input, can i ask does it need to be done with the GD library, is there no way to do it with just php?
07-23-2007, 06:17 PM
With anything other than GD or Imagemagick, you're stuck with
resizing the appearance of an image on the browser, not the actual image itself ...
so the answer to your question is you can't change an image size with PHP alone.
Graham ... give us a link to one of your images and we can show you an easy
PHP/GD example of resizing it to an actual .jpg thumb.
07-23-2007, 07:28 PM
here we go heres an image:
thanks for the help mate
07-23-2007, 08:02 PM
Here's my test page showing original, resized using PHP GD and the PHP script.
(To use .jpg images, change all .gif references to .jpg)
I got the script from this site ... you can see many other examples here:
I didn't deal with the .gif transparent color. There is a way to find the current
transparent color and transfer that to the thumbnail ... I just didn't take the time
to learn how to do that yet.
Here's the scoop on transparency colors:
07-23-2007, 09:02 PM
thanks a lot for that i understand it a lot better now:)
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.