"); return; } //echo("Processing $filename
"); echo("."); flush(); $im = @imagecreatefromjpeg($filename); if (!$im) { echo "error opening image: $filename
"; exit; } list($imgw, $imgh, $imgtype, $imgattr) = getimagesize($filename); //echo("Image size : $imgw x $imgh
"); $ratio = $imgh / $thumb_height; $thumbw = round($imgw / $ratio); $thumbh = round($imgh / $ratio); //echo("Thumbnail size: $thumbw x $thumbh
"); $thumb = @imagecreatetruecolor($thumbw, $thumbh); $ret = @imagecopyresampled($thumb, $im, 0, 0, 0, 0, $thumbw, $thumbh, $imgw, $imgh); $tn_filename = 'TN_'.$filename; @imagejpeg($thumb, $tn_filename); $fname[] = "\"$filename\""; $width[] = $imgw; $height[] = $imgh; $tn_fname[] = "\"$tn_filename\""; $tn_width[] = $thumbw; $tn_height[] = $thumbh; fwrite($tocfile, '$fname[] = "\"'.$filename.'\"";'."\n"); fwrite($tocfile, '$width[] = '.$imgw.';'."\n"); fwrite($tocfile, '$height[] = '.$imgh.';'."\n"); fwrite($tocfile, '$tn_fname[] = "\"'.$tn_filename.'\"";'."\n"); fwrite($tocfile, '$tn_width[] = '.$thumbw.';'."\n"); fwrite($tocfile, '$tn_height[] = '.$thumbh.';'."\n"); } function make_toc() { global $tocfile; $list = array(); $dir = opendir('.'); $tocfile = fopen('album.toc', 'w'); fwrite($tocfile, ""); fclose($tocfile); } if (!is_file('album.toc')) { make_toc(); echo(""); exit; } include('album.toc'); if (isset($album_name)) { $album_caption = "- $album_name"; } else { $album_caption = ""; } ?> Photo Album
0
Loading images...