Hi,
I have made a directory outside the web tree for storing uploaded images. The upload script works fine and also the script for displaying the image, but the latter only works on a windows machine, my mac just shows broken image icons whether using IE5 or NS4.75. Why should the PC be able to get the images from outside the web tree, but not the mac?
If the images are stored in a directory inside the web tree, the problem doesn\'t arise.
The script I\'m using to get the images into the page is from \'PHP and MySQL Web Development\' by Luke Welling and Laura Thompson, and is pasted below. But the problem seems to me to be connected to where the images are stored - I want to store them outside the web tree as otherwise it seems necessary to have a directory which is world-writable to upload them into.
Anyone have any ideas?
<?php
if (!$max_width)
$max_width = 80;
if (!$max_height)
$max_height = 60;
$size = GetImageSize($image);
$width = $size[0];
$height = $size[1];
$x_ratio = $max_width / $width;
$y_ratio = $max_height / $height;
if ( ($width <= $max_width) && ($height <= $max_height) ) {
$tn_width = $width;
$tn_height = $height;
}
else if (($x_ratio $height) < $max_height) {
$tn_height = ceil($x_ratio $height);
$tn_width = $max_width;
}
else {
$tn_width = ceil($y_ratio * $width);
$tn_height = $max_height;
}
$src = ImageCreateFromJpeg($image);
$dst = ImageCreate($tn_width,$tn_height);
ImageCopyResized($dst, $src, 0, 0, 0, 0,
$tn_width,$tn_height,$width,$height);
header(\"Content-type: image/jpeg\");
ImageJpeg($dst, null, -1);
ImageDestroy($src);
ImageDestroy($dst);
?>