1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Rep Power
    I'm trying to create a php page to automatically display all images in a directory I specify, I want all the images to be thumbnailed on the fly, this is what I've come up with so far....

    $TheDirectory = dir($ImageDir);
    while($Filename = $TheDirectory->read()) {

    // Make sure we only show graphic files!
    if ((strstr($Filename, '.jpg') <> False) | | (strstr($Filename, '.gif') <> False) | | (strstr($Filename, '.png') <> False)) {
    // Get info about this image.
    $ImageSize = GetImageSize($TheDirectory->path . $Filename);

    // Create a thumbnail, try to keep the proportions correct
    $ImageScale = $ImageSize[1] / $ImageSize[2];

    $SourcePic = imagecreatefromjpeg ($TheDirectory->path . $Filename);
    $DestPic = imagecreate(100, 100 * $ImageScale);

    // Create a thumbnail from the image
    imagecopyresized($DestPic, $SourcePic 0, 0, 0, 0, 100, 100 * $ImageScale, $ImageSize[1], $ImageSize[2]);

    // Display the image

    // Free up the resouces


    Ok, so $ImageDir is the directory name I send the page, and as you can see I've only set it up to handle jpg files atm.

    So this isn't working, I just get a blank page what I need to know is...
    - How do I find out what version of gd I'm using?
    - Is there a way I can load a image, resize it then output it without using the gd functions? I would rather output the raw headers if possible but I'm not sure how, I'm not sure if my webhost is using the required version of gd, and I'd rather not have to hassle him for months to upgrade it.
    - Does anyone know any examples of thumbnail gallerys I can download?

    [This message has been edited by uTired2 (edited May 26, 2000).]
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Oslo, Norway
    Rep Power
    I haven't messed with the image functions in php yet so I can't really help you, but you should be able to find out version of gd by using:

    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre><? phpinfo(); ?>[/code]


Similar Threads

  1. help: outlook express embedding images problem
    By fade011 in forum Windows Help
    Replies: 2
    Last Post: May 7th, 2004, 12:05 PM
  2. Image uploading butchering images
    By pablo.gosse in forum PHP Development
    Replies: 6
    Last Post: October 19th, 2003, 09:12 PM
  3. Replies: 2
    Last Post: September 26th, 2003, 09:40 AM
  4. Many images eating resources?
    By FragMaster B in forum HTML Programming
    Replies: 3
    Last Post: September 11th, 2003, 09:17 PM
  5. Need help to find closest images through timestamp
    By untexas in forum PHP Development
    Replies: 0
    Last Post: July 25th, 2003, 04:05 PM

IMN logo majestic logo threadwatch logo seochat tools logo