Hi, I found an awesome gallery script and ahve installed it on my website. It ahs automatic thumbnail generation but i cant get it to work can someone check the script and see if its ok?
the problem can be seen at
www.lawsofshotgun.com/Photos/albums.php
the script is found at
http://www.pepperview.com/lefab/ezal...mentation.html
but the problem lies in this section:
{$image = $album->images[$firstIndex + $i + $album->firstImage];
$thumbnailPath = $thumbnailsFolder . "/" . $image->getThumbnail();
if ( !file_exists( $thumbnailPath ) ) // create and cache the thumbnail image if not here
{ $imagePath = $album->imagesFolder . "/" . $image->getFileName();
$im = @ImageCreateFromJPEG ($imagePath);
$size = GetImageSize($imagePath);
$imageWidth = $size[0];
$imageHeight = $size[1];
$thumbWidth = floor( $album->cellsWidth );
$thumbHeight = floor( ( $imageHeight * $album->cellsWidth ) / $imageWidth );
if ( $thumbHeight > $album->cellsHeight )
{
$thumbWidth = floor( ( $imageWidth * $album->cellsHeight )/ $imageHeight );
$thumbHeight = floor( $album->cellsHeight );
}
$tn = ImageCreate($thumbWidth, $thumbHeight);
imagecopyresized($tn, $im, 0, 0, 0, 0, $thumbWidth, $thumbHeight, $imageWidth, $imageHeight);
imagejpeg( $tn, $thumbnailPath );
ImageDestroy( $tn );
ImageDestroy( $im );
}
$t->assign('SRC', $base . "http://www.lawsofshotgun.com/Photos" . $thumbnailsRelativeURL . "tn" . $image->getThumbnail() );
$t->assign('CELLS_HEIGHT', $album->cellsHeight);
$t->assign('CELLS_WIDTH', $album->cellsWidth);
$t->assign('ALBUM_SOURCE', $album_source);
$t->assign('IMAGE_NUMBER', $i + $firstIndex );
$t->parse('CELL', $tag);
$tag = ".cell";
}
Thanks so much for anyone who can help.