I believe the problem is somewhere in the GD script. Because when I view the source it shows an empty variable. I should at least see the name of variable in the source. Any ideas?
<img src='include/function_gd.php?route_photo='..'' height='x' width='x' align='center' id='image'>

On Apr 6, 2005, at 9:46 AM, Bastien Koert wrote:

Have a look here...I have some sample code on calling images from a db. It used the two pages like you do here and passes the ID back and forth to the image production page...maybe it will help



From: Craig Hoffman <[EMAIL PROTECTED]>
To: php-db@lists.php.net
Subject: [PHP-DB] One more GD ? -- filename
Date: Wed, 6 Apr 2005 08:23:40 -0500

Thanks everyone for answering my other post. However, I'm still having trouble passing the image name from the GD script to the image tag. I'm including the GD script below. Any help would be great. Thanks - Craig

//GD script
include ("db.php");
$query = "SELECT route_photo FROM routes WHERE route_photo IS NOT NULL ORDER BY RAND() LIMIT 1";
$result = mysql_query($query, $db) or die(mysql_error());

while($row = mysql_fetch_array($result)) {

        //Photo varibale
                $route_photo = $row["route_photo"];

        //Start GD
        //New Image resize
                $new_width = 125;
                $new_height = 225;

        //Content Type
                header("Content-type: image/jpeg");

//Start new image resize
list($width_orig, $height_orig) = getImageSize("../images/climbs/$route_photo");

                if ($new_width && ($width_orig < $height_orig)) {
                                $new_width = ($new_height / $height_orig) * 
                        } else {
                                $new_height = ($new_width / $width_orig) * 

//resample the image
$thumb = ImageCreateTrueColor($new_width, $new_height);
$tmp_image = ImageCreateFromJPEG("../images/climbs/$route_photo");
ImageCopyResampled($thumb, $tmp_image, 0, 0, 0, 0, $new_width, $new_height, $width_orig, $height_orig);

                ImageJPEG($thumb, $route_photo, '100');

//Image Tag:
echo ("<img src='include/function_gd.php?route_photo=$thumb' align='center' id='image'>");

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

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

Reply via email to