\n"; $match = array(); if(preg_match("#(.*)#si", $html, $match)) { $metadata['title'] = $match[1]; } $links = array(); $match = array(); if(preg_match_all("#]*>#i", $html, $match)) { foreach($match[1] as $link) { // echo "\n"; if(preg_match("#.*\.jpg$#i", $link)) { $url = $dirURL . "/" . basename($link); $links[] = $url; } } } else { echo "\n"; flush(); $img = @imagecreatefromjpeg(cache_name($imageurl)); if($img === null) { echo "\n"; return; } $w_orig= imagesx($img); $h_orig= imagesy($img); $width = $maxw; $height = $maxh; $ratio_orig = $w_orig/$h_orig; if ($ratio_orig < $maxw / $maxh) { // weniger breit $width = $height*$ratio_orig; // ziel schmal machen } else { $height = $width/$ratio_orig; // ziel flach machen } // Resample $img_c = imagecreatetruecolor($width, $height); imagecopyresampled($img_c, $img, 0, 0, 0, 0, $width, $height, $w_orig, $h_orig); imagedestroy($img); @mkdir(dirname($fname), 0777, TRUE); imagejpeg ($img_c, $fname); imagedestroy($img_c); } function assume_cache($images, $maxw, $maxh, $maxtw, $maxth) { foreach($images as $imageurl) { // Original Copy: $fname = cache_name($imageurl); if(!file_exists($fname)) if(!@copy($imageurl, $fname)) { echo "\n"; continue; } // Small Copy: $fname = cache_name($imageurl, ".$maxw.$maxh"); if(!file_exists($fname)) create_cache_file($imageurl, $fname, $maxw, $maxh); // Thumbnail: $fname = cache_name($imageurl, ".$maxtw.$maxth"); if(!file_exists($fname)) create_cache_file($imageurl, $fname, $maxtw, $maxth); GLOBAL $RefreshTime; if(time() > $RefreshTime) { print "

refresh...

"; // $url = $_SERVER["REQUEST_URI"]; //echo "\n"; echo "\n"; exit(); } } } function show_galery($baseURL, $maxw, $maxh, $maxtw, $maxth) { $meta = array(); $images = listImages($baseURL, $meta); $title = $meta['title'] ; if($title == "") $title = "Bildergalerie"; assume_cache($images, $maxw, $maxh, $maxtw, $maxth); // prepared for http://galleria.aino.se: echo "
\n"; foreach($images as $imageurl) { // My description echo ""; echo "\"$title\"\n"; } echo "
\n"; } ?> Bilder-Galerien der HTL Wien 10