Hi David
Thanks for replying. I posted this message on Zend.com as well, got some replies, so this is what I just posted in response.
Can you see anything that would cause a problem?
Here is the important bits of the code:
Firstly, the starting PHP page has the following:
<?PHP
$root_dir="..";
$website_dir="$root_dir"."/mywebsite";
$number_of_rows=3;
$images_per_row=3;
$thumbnail_ratio=4; $images_per_page=$number_of_rows*$images_per_row;
include ("$root_dir"."/php_libraries/thumbnail.php");
?>
Everything else in this program is HTML.
I have tried using the complete path such as /library/webserver etc in all places, and have done away with the two vars $root_dir and $website_dir altogether, but problem remains the same. I don't think the issue is I'm pointing to the wrong place.
Ok, thumbnail.php has the line:
print("<td align=\"center\"><a href=\"$website_dir/draw_image.php\"><img src=\"$root_dir/php_libraries/resize_image.php?temporary_data=$temporary_data&root_dir=$root_dir\"></a></td>\n");
The link works as expected, and if I replace the img src with a graphic name instead (i.e. image.jpg) which is in the dir php_libraries, it works.
And then resize_image.php looks like this:
<?PHP
Header("Content-type: image/jpeg");
$temporary_data=escapeshellcmd($temporary_data);
$src_img=ImageCreateFromJPEG("$root_dir"."/images/"."$temporary_data");
$original_size_x=imagesx($src_img);
$original_size_y=imagesy($src_img);
$new_size_x=$original_size_x/4;
$new_size_y=$original_size_y/4;
$dest_img=ImageCreateTrueColor($new_size_x,$new_size_y);
ImageCopyResized($dest_img,$src_img,0,0,0,0,$new_size_x,$new_size_y,$original_size_x,$original_size_y);
ImageJPEG($dest_img);
ImageDestroy($dest_img);
ImageDestroy($src_img);
?>