So i found a script that does what I want but I'm having trouble "implementing" it. Basically I have all the image file names stored in my table and i want them to all display (the ones uploaded by the particular user logged in) on a page.
Of course I don't want them enormous, just small thumbnail images would do. I don't want them clickable or anything, i don't even want them to enlarge. But because of the whole portrait and landscape thing, i didn't want to hardcode the size in html. so, after searching i found this script:
function createThumb($source,$dest) {
$thumb_size = 150;
$size = getimagesize($source);
$width = $size[0];
$height = $size[1];
if($width> $height) {
$x = ceil(($width - $height) / 2 );
$width = $height;
} elseif($height> $width) {
$y = ceil(($height - $width) / 2);
$height = $width;
}
$new_im = ImageCreatetruecolor($thumb_size,$thumb_size);
$im = imagecreatefromjpeg($source);
imagecopyresampled($new_im,$im,0,0,$x,$y,$thumb_size,$thumb_size,$width,$height);
imagejpeg($new_im,$dest,100);
}
here's how I'm calling the function:
<?php
$path = "upload/$pic1";
echo
"<img src=\"'".createThumb($path)."'\" />";
?>
(that's in a while statement)
i get a page full of wingdings and it says i'm also missing an argument. can anyone help?? the directions with this script really suck and don't explain anything.
thanks!