I'm trying to create a photo gallery for my new website. I can't seem to get the GD library to create the images.
<?php
header ("Content-type: image/jpeg");
$filepath = "/home/ronhnels/public_html/photography/photography/tnelson";
$url_path = "tnelson";
$dir = dir($filepath);
while($entry=$dir->read()) {
if($entry == "." || $entry == "..") {
continue;
}
$fp = @fopen("$filepath/$entry", "r");
if(!$fp) {
print "Bad entry: $entry<br />";
continue;
}
$name = fgets($fp, 4096);
fclose($fp);
$ret = getimagesize("$url_path/$entry");
//var_dump($ret);
//print_r($ret);
echo "<br /><br />";
$new_x = ($ret[0]/2);
$new_y = ($ret[1]/2);
$im = @imagecreatetruecolor($new_x, $new_y);
imagejpeg($im);
imagedestroy($im);
}
?>
Does anyone know what is wrong or a good way to dynamically create a photogallery. Once I get the images to be created I'll get down to the finer detals of placement and what not.