$destdate)) { global $ImageTool; $imgsize = GetImageSize($source); $width = $imgsize[0]; $height = $imgsize[1]; if ($height<$width) { $new_width = $size; $new_height = ceil($size * $height / $width); }else { $new_width = ceil($size * $width / $height); $new_height = $size; } if ($ImageTool == "gd") { $im = ImageCreateFromJPEG($source); $new_im = ImageCreate($new_width,$new_height); ImageCopyResized($new_im,$im,0,0,0,0,$new_width,$new_height,ImageSX($im),ImageSY($im)); ImageJPEG($new_im,$dest,75); } elseif ($ImageTool == "im") { // Older ImageMagick //system("$convert -quality 80 -antialias -sample $new_width" . "x" . "$new_height -bordercolor black -border $border \"$source\" \"$dest\" 2>&1"); // Newer ImageMagick system("$convert -quality 80 -antialias -sample $new_width" . "x" . "$new_height -bordercolor black -border $border" . "x" . "$border \"$source\" \"$dest\" 2>&1"); } } } function NavBar($mode,$path,$start) { $endpoint = basename($path); global $pix_base; global $realbase; global $dispsize; global $sitehome; global $display_cols; if ($sitehome != '') { print "Home -> \n"; } print "Albums\n"; $doo = split("/",$path); $prepath = ''; while (list($foo,$filename) = each($doo)) { if ($prepath) { $fullname = $prepath . "/" . $filename; } else { $fullname = $filename; } if ($filename == $endpoint) { print " -> $filename\n"; } else { print " -> $filename\n"; } $prepath = $fullname; } $fn = $pix_base . "/" . $path; $infofile = ""; if (is_dir($fn)) { $infofile = $pix_base . "/" . $path . "/info.txt"; } else { $infofile = $pix_base . "/" . preg_replace('/(.*)\.jpg/i', '\1.txt', $path); } if (file_exists($infofile)) { list($pictureTitle,$desc) = ParseInfoFile($infofile, $name); print " \n

" . $pictureTitle . "

"; } } function PrintAlbumName($pix_base, $name) { $infofile = $pix_base . "/" . $name . "/info.txt"; $photoAlbumTitle = ""; if (file_exists($infofile)) { list($photoAlbumTitle,$desc) = ParseInfoFile($infofile, $name); } else { $photoAlbumTitle = $name; } print ""; print "$photoAlbumTitle\n"; print "
\n"; } // Info files have two lines - one is the "title" and the second is a longer // "description". function ParseInfoFile($filename, $basename) { return(file($filename)); } function ParseInfoFileThumb($path, $file) { global $pix_base; global $useFileNames; $fn = $pix_base . "/" . $path; $infofile = ""; $infofile = $fn . "/" . preg_replace('/(.*)\.jpg/i', '\1.txt', $file); if (file_exists($infofile)) { list($pictureTitle,$desc) = file($infofile); return $pictureTitle; } else if($useFileNames=="no"){ return "";} else return $file; } function checkDir($pathname) { $darray = split("/",$pathname); for ($x = 1; $x < sizeof($darray); $x++) { $checkdir = ''; for($y = 1; $y <= $x; $y++) { $checkdir .= "/" . $darray[$y]; } if (file_exists($checkdir)) { } else { mkdir($checkdir,0755); } } } ?>