"; echo ""; echo "
Impressionen vom Sillianer Faschingsumzug 2017

Bildergalerie

"; echo "
"; //-- config ende ------------------------------------- function is_image($filename,$typearray) { reset($typearray); while($val=each($typearray)) { if (strstr($filename,$val[value])!==false) { return true; } } } function ImageResize (&$src, $x, $y) { /* Function derived from ImageCopyResampleBicubic() Original code in C, for the PHP GD Module by jernberg@fairytale.se Port to PHP by John Jensen July 10 2001 Updated by tim@smoothdeity.com Re-edited & optimized by TCK */ $dst=ImageCreate ($x, $y); $pals=ImageColorsTotal ($src); for ($i=0; $i<$pals; $i++) { $colors=ImageColorsForIndex ($src, $i); ImageColorAllocate ($dst, $colors['red'], $colors['green'], $colors['blue']); } $scX =(imagesx ($src)-1)/$x; $scY =(imagesy ($src)-1)/$y; $scX2 =intval($scX/2); $scY2 =intval($scY/2); for ($j = 0; $j < ($y); $j++) { $sY = intval($j * $scY); $y13 = $sY + $scY2; for ($i = 0; $i < ($x); $i++) { $sX = intval($i * $scX); $x34 = $sX + $scX2; $c1 = ImageColorsForIndex ($src, ImageColorAt ($src, $sX, $y13)); $c2 = ImageColorsForIndex ($src, ImageColorAt ($src, $sX, $sY)); $c3 = ImageColorsForIndex ($src, ImageColorAt ($src, $x34, $y13)); $c4 = ImageColorsForIndex ($src, ImageColorAt ($src, $x34, $sY)); $r = ($c1['red']+$c2['red']+$c3['red']+$c4['red'])/4; $g = ($c1['green']+$c2['green']+$c3['green']+$c4['green'])/4; $b = ($c1['blue']+$c2['blue']+$c3['blue']+$c4['blue'])/4; ImageSetPixel ($dst, $i, $j, ImageColorClosest ($dst, $r, $g, $b)); } } return ($dst); } function mkthumb($fileim,$x,$y,$fileth) { // echo "$fileim,$x,$y,$fileth
"; if (file_exists($fileth)) { $t=imagecreatefromjpeg($fileth); $by=imagesy($t); if (!($by==$y)) { $b=imagecreatefromjpeg($fileim); $bx=imagesx($b); $by=imagesy($b); $xn=intval($bx*$y/$by); $m=imagecreatetruecolor($x,$y); //$m=ImageResize($b,$xn,$y); ImageCopyResampled($m,$b,0,0,0,0,$x,$y,$bx,$by); imagejpeg($m,$fileth); } } else { $b=imagecreatefromjpeg($fileim); $bx=imagesx($b); $by=imagesy($b); $xn=intval($bx*$y/$by); $m=imagecreatetruecolor($x,$y); ImageCopyResampled($m,$b,0,0,0,0,$x,$y,$bx,$by); //$m=ImageResize($b,$xn,$y); imagejpeg($m,$fileth); //echo "$bx,$by,$xn
"; } return ($m); } //-- functions ende ---------------------------------- if (!isset($mmstart)) { $mmstart=0; } // Anzeige eines Bildes oder Übersicht? if ($subfile!="") { // Bild anzeigen echo ""; echo "
<- zurück"; } else { // Gallery anzeigen $handle=opendir($imagedir); $n=0; $filearray=Array(); while (false !== ($file = readdir($handle))) { if ($file != "." && $file != ".." && is_image($file,$imagetypes)) { $filearray[]=$file; } } asort($filearray); reset($filearray); // skip images... for ($n=0;$n<$mmstart;$n++) $ffile=each($filearray); $n=0; while ($ffile=each($filearray)) { $file=$ffile[value]; // generate thumbnail, if nessesairy. Now THIS is fun :) // natuerlich nur, wenn imagemagick vorhanden ist... mkthumb($imagedir."/".$file,$thb_x_size,$thb_y_size,$thumbnails."/".$file); $thumbnail=true; # if ($n%$cols==0) # echo "\n"; $url="galerie8.php?subfile=".$imageurl."/".$file; echo "".($thumbnail ? "":"$file").""; $n++; # if ($n%$cols==0) # echo "\n"; // nur solange wie's not tut... # if ($n>=$rows*$cols) # break; } #echo " "; #if ($mmstart>0) { # $url="galerie8.php?mmstart=".($mmstart-$rows*$cols); # echo "vorherige Bilder..."; #} #echo " | zeige Bilder ".($mmstart+1)." - ".($mmstart+$n)." | "; #if ($n+$mmstartweitere Bilder..."; #} echo "
"; #echo "\n"; #echo ""; echo ""; } // Ende Gallery anzeigen ?>