"; //$stylesheet="";
if(!isset($browsertitle))
$browsertitle="Image browser";
if(!isset($slidetitle))
$slidetitle= "Slideshow";
if(!isset($description))
$description= ""; //leave blank for no search engine indexing
if(!isset($keywords))
$keywords= ""; //leave blank for no search engine indexing
if(!isset($autoplay)){
if((isset($hideControlElements))&&($hideControlElements))
$autoplay=true; //if there are no controls then we have to start automatically of course
else
$autoplay=false; //Shall presentation start automatically when in slideshow mode?
}
if(!isset($stopOnMouseOver))
$stopOnMouseOver=true;//Shall playing be interrupted while the mouse is over a photo (slideshow mode)?
if(!isset($openLinksIn))
$openLinksIn="_blank"; //if there is a link associated with the clicked image, open link in this window (can also be "_self" or "_parent" or some name).
if(!isset($openLinkOpts))
$openLinkOpts=""; //optionally you can set options for the new window (height, width, menubar, resizable ...)
//with value "auto" the script will use the preferred language of the browser, or, if not present, English.
if(!isset($lang))
$lang="auto"; //can also be set to fixed "English" or "German" or "Swedish" or "Dutch" or "Norwegian" or "Portuguese" or "French" or "Russian" or "Italian"
//$hideControlElements=true;//useful for embedded frames
//$basePath="./"; //use "." for browsing current directory
//or for example "./photos" to browse subdir photos
//browser settings
if(!isset($imgsperline))
$imgsperline=5; //5 columns
if(!isset($imgspercolumn))
$imgspercolumn=3; //default 3 rows
$maxperpage=$imgsperline*$imgspercolumn;
//IF BROWSE MODE DOES NOT WORK PROPERLY CHANGE $GD_WORKAROUND=""; TO $GD_WORKAROUND="oldGD";
//thumbnail settings
if(!isset($GD_WORKAROUND))
$GD_WORKAROUND=""; //set this to "oldGD" or "newGD" to switch off automatic GD version detection
//set to "oldGD" if you experience any trouble with the browse mode!
if(!isset($scrwidth))
$scrwidth=1020; //important _only_ for resulution of preview thumbs in browser mode
if(!isset($thumbQuality))
$thumbQuality=90; //jpeg compression of thumbs (0 worst, 100 best quality but also largest size)
if(!isset($resample))
$resample=true; //resample images when creating thumbs - set to true if you have a fast server as quality is a lot better, but takes a bit of processing
$imgwidth=$scrwidth/$imgsperline; // - if possible make $scrwidth be divisible by both columns and rows without remainder
$realimgwidth=$imgwidth+5; //plus 4 for cellspacing and 1 for imageborder
if(!isset($allowZip))
$allowZip=true; //do you want to give people the opportunity to download all photos in one zip-file?
//slideshow settings
if(!isset($initialDelay))
$initialDelay=5;//how long shall the overall display time (in seconds) of a picture be initially
if(!isset($preloadForward))
$preloadForward=3;//how many pictures do you want to preload ahead?
if(!isset($useFading))
$useFading =true;//do you want to blend between images? (does not work in oldGD mode!)
if(!isset($fadeMode))
$fadeMode =rand(0,4);//0:classic, 1:right-to-left, 2:left-to-right, 3:square fading type
if(!isset($fadeColor))
$fadeColor =255; //fade to this grey tone [e.g. 255 is #FFFFFF, 0 equals #000000]
if(!isset($bgcolor))
$bgcolor="#fff";//*#aaa;/*this #aaa and the border #aaa's to #000*/
if(!isset($fadeSteps))
$fadeSteps =6; //how many shade levels for fadeing
if(!isset($fadeTime))
$fadeTime =70; //milliseconds for one shade level
//(i.e. overall fade time = $fadeSteps*$fadeTime;
// overall fade time must not be bigger than 1200!)
if(!isset($startFit))
$startFit =true;//shall the slideshow initially fit images to screen or show the actual size
if(!isset($showTitle))
$showTitle =true;//when the mouse is moved over the current image shall it's title be shown as a tooltip?
if(!isset($dateOrder))
$dateOrder=false;//sort images by date rather than by their filename
if(!isset($randomOrder))
$randomOrder=false;//display in random order; this only makes sense for slideshows and not browsing!
if(!isset($showPicSize))
$showPicSize=false;//show or hide the size of the picture, e.g. (640x480)
if(!isset($showPicNum))
$showPicNum=true; //show or hide the number of the current image and total number, e.g. 5/11
//select language:
if($lang=="auto"){
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
$_SERVER['HTTP_ACCEPT_LANGUAGE']=strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']);
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="de")
$lang="German"; //some kind of German set as preferred language
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="sv")
$lang="Swedish"; //some kind of Swedish set as preferred language
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="nl")
$lang="Dutch"; //some kind of Dutch set as preferred language
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="no")
$lang="Norwegian"; //some kind of Norwegian set as preferred language
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="nb")
$lang="Norwegian"; //some kind of Norwegian set as preferred language
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="nn")
$lang="Norwegian"; //some kind of Norwegian set as preferred language
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="pt")
$lang="Portuguese"; //some kind of Portuguese set as preferred language
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="fr")
$lang="French"; //some kind of French set as preferred language
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="ru")
$lang="Russian"; //some kind of Russian set as preferred language
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="es")
$lang="Spanish"; //some kind of Spanish set as preferred language
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="it")
$lang="Italian"; //some kind of Italian set as preferred language
if(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2)=="da")
$lang="Danish"; //some kind of Italian set as preferred language
if($lang=="auto") //OK, no language found we have available, settle for default
$lang="English";
}else
$lang="English";//default if preferred language is not transmitted
}
//begin language specific strings for ENGLISH
$pauseString="pause";
$playString="play";
$actualString="actual size";
$fitString="fit on screen";
$browseString="browse pictures";
$slidesString="start slideshow";
$nextString="next";
$backString="back";
$nextPageString="next page";
$priorPageString="prior page";
$secString="sec";
$delayString="delay";
$notLoadedString="Image not fully loaded yet, please be patient...";
$downloadString="Click OK if you want to download all #NUM# photos in one single zip archive with a size of approximately #SIZE#.";
$downloadButton="download all";
$aftertext ="
If you are shown on a picture and don't want this let me know and I will remove it. This page is autogenerated, get the script.
";
//$aftertext comes after the rest of the page at the bottom
//Some kind of disclaimer is surely useful and I would really
//very much appreciate it if you let people where they can
//get this script, but it's up to you if and where to do it.
//end language specific strings for ENGLISH
if($lang=="German"){ //begin language specific strings for GERMAN
$pauseString="Pause";
$playString="Start";
$actualString="tatsächliche Größe";
$fitString="Größe anpassen";
$browseString="Browser-Modus";
$slidesString="Slideshow-Modus";
$nextString="weiter";
$backString="zurück";
$nextPageString="nächste Seite";
$priorPageString="vorige Seite";
$secString="Sek";
$delayString="zeigen";
$notLoadedString="Bild ist noch nicht ganz geladen, bitte gedulde Dich einen Moment...";
$downloadString="Klicke OK wenn Du alle #NUM# Photos in einem einzigen zip-Archiv mit einer Grösse von ca. #SIZE# herunterladen willst.";
$downloadButton="Alle herunterladen";
$aftertext ="
Wenn Du auf einem Photo abgebildet bist und das nicht möchtest kontaktiere mich bitte und ich werde es sofort entfernen. Diese Seite ist automatisch erzeugt, hol Dir das Skript.
";
//$aftertext kommt nach dem Rest der Seite ganz unten
//Irgendeine Klausel sit sicherlich angebracht und ich wuerde
//es sehr begruessen wenn Du Leute wissen laesst wo sie dieses
//Skript bekommen koennen, aber ob und wie ist Deine Sache.
}//end language specific strings for GERMAN
//Swedish translation credits to Robert Eriksson, www.hellre.de
if($lang=="Swedish"){ //begin language specific strings for SWEDISH
$pauseString="Pause";
$playString="Start";
$actualString="Verklig storlek";
$fitString="Anpassa storlek";
$browseString="Bläddra";
$slidesString="Bildspel";
$nextString="Nästa";
$backString="Bakåt";
$nextPageString="Nästa sida";
$priorPageString="Föregående sida";
$secString="Sek";
$delayString="fördröjning";
$notLoadedString="Bilden laddas...vänta...";
$downloadString="Klicka OK ifall du vill ladda ner alla bilder i en enda
zip-fil med en storlek på ca. #SIZE# .";
$downloadButton="Ladda ner alla";
$aftertext ="
Syns du på ett foto
och inte vill vara med? Kontakta oss så åtgärdar vi detta. Denna
sida är automatiskt genererad, ladda ner scriptet.
";
//$aftertext visas längst ned på sidan
//Lite kredit för jobbet är uppskattat och jag skulle uppskatta
//ifall du talar om var folk kan ladda ner det här scriptet ifrån
//men det är upp till dig om och eventuellt vars du skriver detta.
}//end language specific strings for SWEDISH
//Dutch translation credits to Hans Gradussen, www.bizzibi.nl
if($lang=="Dutch"){ //begin language specific strings for DUTCH
$pauseString="Pause";
$playString="Start";
$actualString="Origineel formaat";
$fitString="Afmeting aanpassen";
$browseString="Overzicht";
$slidesString="Slideshow";
$nextString="verder";
$backString="terug";
$nextPageString="volgende pagina";
$priorPageString="vorige pagina";
$secString="Sec";
$delayString="tonen";
$notLoadedString="Afbeelding wordt geladen...";
$downloadString="Klik op OK om alle #NUM# foto's in een ZIP-bestand (ca.
#SIZE#) te downloaden.";
$downloadButton="Alles downloaden";
$aftertext ="
";
//Some kind of disclaimer is surely useful and I would really
//very much appreciate it if you let people where they can
//get this script, but it's up to you if and where to do it.
}//end language specific strings for Dutch
//Norwegian translation credits to Erik Retvedt, www.retvedt.as
if($lang=="Norwegian"){ //begin language specific strings for NORWEGIAN
$pauseString="Pause";
$playString="Spill";
$actualString="Aktuell størrelse";
$fitString="Tilpass skjerm";
$browseString="Klikk for å søke på bilder";
$slidesString="Klikk for å se lysbildeshow";
$nextString="Neste";
$backString="Tilbake";
$nextPageString="Neste side";
$priorPageString="Forrige side";
$secString="sek";
$delayString="mellom bilder";
$notLoadedString=" Bildene er ikke lastet opp, vennligst vær tålmodig...";
$downloadString="Klikk OK om du vil laste ned alle bildene i en ZIP fil.
Størrelsen vil være på ca #SIZE#.";
$downloadButton="Last ned alle";
$aftertext ="
Hvis du er med på et bilde, men ikke vil være det så kan du
sende meg en mail. Denne side er laget automatisk. Vil du teste scriptet trykk her.
";
//comes after the rest of the page at the bottom
}//end language specific strings for NORWEGIAN
//Portuguese translation credits to Lígia Moreira
if($lang=="Portuguese"){//begin language specific strings for PORTUGUESE
$pauseString="pausa";
$playString="começar";
$actualString="tamanho actual";
$fitString="ajustar ao ecrã";
$browseString="clique para navegar";
$slidesString="clique para ver o slideshow";
$nextString="seguinte";
$backString="anterior";
$nextPageString="página seguinte";
$priorPageString="página anterior";
$secString="seg";
$delayString="demora";
$notLoadedString="Imagem ainda não completamente carregada; espere, por favor...";
$downloadString="Clique OK se quiser fazer o download de todas as #NUM# fotos num único arquivo zipado com o tamanho aproximado de #SIZE#.";
$downloadButton="fazer o download de todas";
$aftertext ="
Se aparecer numa imagem e não quiser que isso aconteça, dê-me a conhecer o facto e removê-la-ei. Esta página é autogerada, obtenha o script aqui.
";
//$aftertext comes after the rest of the page at the bottom
//Some kind of disclaimer is surely useful and I would really
//very much appreciate it if you let people where they can
//get this script, but it's up to you if and where to do it.
}//end language specific strings for PORTUGUESE
//French translation credits to Lígia Moreira
if($lang=="French"){//begin language specific strings for FRENCH
$pauseString="pause";
$playString="jouer";
$actualString="taille actuelle";
$fitString="mode écran";
$browseString="cliquer pour naviguer";
$slidesString="cliquer pour voir le slideshow";
$nextString="suivante";
$backString="antérieure";
$nextPageString="page suivante";
$priorPageString="page antérieure";
$secString="sec";
$delayString="attente";
$notLoadedString="Image pas encore complètement téléchargée; attendez, s'il vous plaît...";
$downloadString="Cliquez OK si vous voulez télécharger toutes les #NUM# photos dans un seul archive zippé avec la taille, à peu près de #SIZE#.";
$downloadButton="télécharger toutes";
$aftertext ="
Si vous êtes dans une image et vous ne le voulez pas, faites- moi en savoir et je l'éffacerai. Cette page est autogénérée, obtenez le script ici.
";
//$aftertext comes after the rest of the page at the bottom
//Some kind of disclaimer is surely useful and I would really
//very much appreciate it if you let people where they can
//get this script, but it's up to you if and where to do it.
}//end language specific strings for FRENCH
//Russian translation credits to Slavik Fursov
if($lang=="Russian"){ //begin language specific strings for Russian
$pauseString="Пауза";
$playString="старт";
$actualString="настоящий размер";
$fitString="по размерам экрана";
$browseString="показать все";
$slidesString="смотреть, как слайды";
$nextString="следующая";
$backString="назад";
$nextPageString="след. страница";
$priorPageString="пред. страница";
$secString="сек";
$delayString="задержка";
$notLoadedString="Фото загружается, подожтите чуть...";
$downloadString="Вы хотите загрузить #NUM# фотографий в одном архивированном файле размером около #SIZE#?";
$downloadButton="скачать всё";
$aftertext ="
Если вы на этой фото и хотите, чтобы этого не было - дайте нам знать. Страница сгенерирована автоматически, скопируйте скрипт here.
";
//$aftertext comes after the rest of the page at the bottom
//Some kind of disclaimer is surely useful and I would really
//very much appreciate it if you let people where they can
//get this script, but it's up to you if and where to do it.
}//end language specific strings for Russian
//Spanish translation credits to Dieter Zilant
if($lang=="Spanish"){ //begin language specific strings for Spanish
$pauseString="pausa";
$playString="play"; //- tocar ("play" is commonly used)
$actualString="tamaño actual";
$fitString="acomodar en pantalla";
$browseString="haz clic para revisar";
$slidesString="haga clic para ver diapositivas";
$nextString="próximo";
$backString="regresar";
$nextPageString="próxima pagina";
$priorPageString="pagina anterior";
$secString="sec";
$delayString="espera";
$notLoadedString="No totalmente cargada, paciencia por favor...";
$downloadString="Haz clic en OK si quiere bajar todas las #NUM# fotos en un solo archivo (Zip) con tamaño aproximado de: #SIZE#.";
$downloadButton="bajar todas";
$aftertext ="
Si usted aparece en una foto y no quiere estar, avíseme y la quito. Esta página es producido automáticamente, el guión está aquí.
";
}//end language specific strings for Spanish
//Italian translation credits to Roberto (fantasyl)
if($lang=="Italian"){ //begin language specific strings for ITALIAN
$pauseString="PAUSA";
$playString="RIPRODUCI";
$actualString="DIMENSIONI REALI";
$fitString="ADATTA ALLA PAGINA";
$browseString="SFOGLIA LA GALLERIA";
$slidesString="GUARDA LA GALLERIA";
$nextString="AVANTI";
$backString="INDIETRO";
$nextPageString="PROSSIMA PAGINA";
$priorPageString="PAGINA PRECEDENTE";
$secString="SECONDI";
$delayString="RITARDO";
$notLoadedString="IMMAGINE NON CARICATA COMPLETAMENTE. PER FAVORE ATTENDERE...";
$downloadString="SCEGLI OK SE VUOI SCARICARE TUTTE LE #NUM# FOTO IN UN SINGOLO ARCHIVIO COMPRESSO (ZIP) DI DIMENSIONE PARI A CIRCA #SIZE#.";
$downloadButton="SCARICA TUTTO";
$aftertext ="
";
}
//$aftertext comes after the rest of the page at the bottom
//Some kind of disclaimer is surely useful and I would really
//very much appreciate it if you let people where they can
//get this script, but it's up to you if and where to do it.
//end language specific strings for ITALIAN
//Danish translation credits to Jens Knudsen.�
if($lang=="Danish"){ //begin language specific strings for Danish
$pauseString="Pause";
$playString="Kør";
$actualString="Aktuel størrelse";
$fitString="Tilpas skærm";
$browseString="Oversigt";
$slidesString="Start slideshow";
$nextString="Næste";
$backString="Tilbage";
$nextPageString="Næste side";
$priorPageString="Forrige side";
$secString="sek";
$delayString="mellem billeder";
$notLoadedString=" Billedene er ikke indlæst, vær tålmodig...";
$downloadString="Klik OK hvis du vil downloade alle #NUM# billeder i en ZIP fil. Størrelsen vil være på ca. #SIZE# ";
$downloadButton="Download alle";
$aftertext ="
Hvis du er med på et billede, men ikke vil være det så kan du sende mig en mail. Denne side er lavet automatisk. Vil du teste scriptet tryk her.
";
//comes after the rest of the page at the bottom
}
//end language specific strings for Danish
$outputForm=0;
$doctype="\r\n";
$doctype="";//for strange reasons Firefox does not allow "?" in the stylesheet link when HTML 4.01 is used!
$encoding="\r\n";
$QUERY_STRING=$_SERVER['QUERY_STRING'];
if(!isset($SCRNAME))
$SCRNAME=$SCRIPT_NAME; //for calling ourselves lateron
$sep="&"; //seperating string for the options in QUERY_STRING
if((isset($hideControlElements))&&($hideControlElements)){
$wiwiMargin=36;
$wiheiMargin=36;
}
else{
$wiwiMargin=50;
$wiheiMargin=132;
}
if(!isset($basePath))
$basePath="./";
else
if(substr($basePath,strlen($basePath)-1,1)!="/")
$basePath.="/"; //always attach the final slash
//begin workaround for older PHP/GD versions
//helper function
function gd_version() {
static $gd_version_number = null;
if ($gd_version_number === null) {
// Use output buffering to get results from phpinfo()
// without disturbing the page we're in. Output
// buffering is "stackable" so we don't even have to
// worry about previous or encompassing buffering.
ob_start();
phpinfo(8);
$module_info = ob_get_contents();
ob_end_clean();
if (preg_match("/\bgd\s+version\b[^\d\n\r]+?([\d\.]+)/i",
$module_info,$matches)) {
$gd_version_number = $matches[1];
} else {
$gd_version_number = 0;
}
}
return $gd_version_number;
}
$args=explode($sep,$QUERY_STRING);
if($GD_WORKAROUND==""){
if($args[0]=="oldGD"){
array_shift($args);
$newGD=false;
}
else{
if($args[0]=="newGD"){
array_shift($args);
$newGD=true;
}
else{
if(gd_version() >= 2)
$newGD=true;
else
$newGD=false;
}
}
if($newGD)
$GD_WORKAROUND="newGD";
else
$GD_WORKAROUND="oldGD";
}else
if(($args[0]=="oldGD")||($args[0]=="newGD"))
array_shift($args); //just get rid of the parameter
if($GD_WORKAROUND=="oldGD")
$useFading=false; //Fading needs proper GD library
//end workaround for older PHP/GD versions
if((sizeof($args)>0) && $args[0]=="opaque"){
if(sizeof($args)>2)
$faMo=$args[3];
else
$faMo=0;
$scaleQ=20; //how high shell the resolution be; important for gradients
if($faMo==0){
$size = 1;
$image=imagecreatetruecolor($size, $size);
imagealphablending($image,false);
imagesavealpha($image,true);
imagefilledrectangle($image, 0, 0, $size, $size, imagecolortransparent($image));
$opaque=$args[1];
if($opaque>127)
$opaque=127;
if($opaque<0)
$opaque=0;
$back2 = imagecolorallocatealpha($image, $fadeColor, $fadeColor, $fadeColor, $opaque);
imagefilledrectangle($image, 0, 0, $size, $size, $back2);
}
if(($faMo==1)||($faMo==2)){
$size=$fadeSteps*$scaleQ;
$image=imagecreatetruecolor($size, 1);
imagealphablending($image,false);
imagesavealpha($image,true);
imagefilledrectangle($image, 0, 0, $size, 1, imagecolortransparent($image));
$step=($args[2])*$scaleQ;
for($i=$size;$i>0;$i--){
$opaque=127.0-round((127.0/$size)*($step+($size/2.0)-$i));
if($opaque>127)
$opaque=127;
if($opaque<0)
$opaque=0;
$back2 = imagecolorallocatealpha($image, $fadeColor, $fadeColor, $fadeColor, $opaque);
if($faMo==1)
imagefilledrectangle($image, $size-$i-1, 0, $size-$i, 1, $back2);
if($faMo==2)
imagefilledrectangle($image, $i-1, 0, $i, 1, $back2);
}
}
if($faMo==3){
$size=$fadeSteps*$scaleQ;
$image=imagecreatetruecolor($size*2, $size*2);
imagealphablending($image,false);
imagesavealpha($image,true);
imagefilledrectangle($image, 0, 0, $size*2, $size*2, imagecolortransparent($image));
$step=($args[2])*$scaleQ;
for($i=$size;$i>0;$i--){
$opaque=127.0-round((127.0/$size)*($step+($size/2.0)-$i));
if($opaque>127)
$opaque=127;
if($opaque<0)
$opaque=0;
$back2 = imagecolorallocatealpha($image, $fadeColor, $fadeColor, $fadeColor, $opaque);
imagerectangle($image, $i-1, $i-1, $size*2-$i, $size*2-$i, $back2);
}
}
if($faMo==4){
$size=$fadeSteps*$scaleQ;
$image=imagecreatetruecolor($size*2, 1);
imagealphablending($image,false);
imagesavealpha($image,true);
imagefilledrectangle($image, 0, 0, $size, 1, imagecolortransparent($image));
$step=($args[2])*$scaleQ;
for($i=$size;$i>0;$i--){
$opaque=127.0-round((127.0/$size)*($step+($size/2.0)-$i));
if($opaque>127)
$opaque=127;
if($opaque<0)
$opaque=0;
$back2 = imagecolorallocatealpha($image, $fadeColor, $fadeColor, $fadeColor, $opaque);
imagefilledrectangle($image, $size*2-$i-1, 0, $size*2-$i, 1, $back2);
imagefilledrectangle($image, $i-1, 0, $i, 1, $back2);
}
}
header('Content-type: image/png');
// and finally, output the result
imagepng($image);
imagedestroy($image);
die();
}
//begin part for giving out resized images:
//Input: image_filename / sizeX / sizeY
//Output:the image reduced to sizeX*sizeY
//Use: normally images are resized after loading on client
// - this will do the resize on server, saving loading time
if((sizeof($args)>0) && $args[0]=="image"){
array_shift($args);
if((sizeof($args)==3 || sizeof($args)==2)&&file_exists($basePath.rawurldecode($args[0]))){
$args[0]=$basePath.rawurldecode($args[0]);
$info=getimagesize("$args[0]");
if($info[2]==1)
$test=imagecreatefromgif($args[0]);
if($info[2]==2)
$test=imagecreatefromjpeg($args[0]);
if($info[2]==3)
$test=imagecreatefrompng($args[0]);
if($info[2]==4)
$test=imagecreatefromwbmp($args[0]);
if(sizeof($args)==2){ //keep ratio
$width=$args[1];
$height=$info[1]*($args[1]/$info[0]);
}
else{ //resize image
$width=$args[1];
$height=$args[2];
}
if($newGD) {
$image = ImageCreateTrueColor($width, $height);
} else {
$image = ImageCreate($width, $height);
}
if($resample)
imagecopyresampled($image,$test,0,0,0,0,$args[1],$height,$info[0],$info[1]);
else
imagecopyresized($image,$test,0,0,0,0,$args[1],$height,$info[0],$info[1]);
imageinterlace($image,1);
header('Content-type: image/jpeg');
imagejpeg($image,"",$thumbQuality);
imagedestroy($image);
imagedestroy($test);
}
else
if($QUERY_STRING!="" && sizeof($args)>0 && !file_exists(rawurldecode($args[0])))
echo "File ".rawurldecode($args[0])." not found!";
else
echo "Parameters expected: SCRIPTNAME?filename$sep"."sizeX$sep"."sizeY or SCRIPTNAME?filename$sep"."sizeX. In the latter case original ratio will be kept.";
die;
}
//end part for giving out resized images
//begin part for diagnosis
if((sizeof($args)>0) && $args[0]=="diag"){
array_shift($args);
//phpinfo();
error_reporting(E_ALL);
echo "Problem diagnosis for PHPShow script
Problem diagnosis for PHPShow script
Contact the author, Johannes Knabe, with this output if you have problems with the script!
GD graphics library version (should be 2.0 or higher): ";
$gdi=gd_info();
echo $gdi["GD Version"];
$testimg="http://".$_SERVER["SERVER_NAME"].$_SERVER["SCRIPT_NAME"]."?opaque".$sep."64".$sep."3".$sep."0";
echo " Testing script image generation ($testimg)... ";
$ist=getimagesize($testimg);
var_dump($ist);
if($ist[0]>0)
echo "seems to be fine!";
else
echo "^ERROR ".$ist[0].". Please make sure there is nothing (really really nothing, not even whitespace) around the PHP tags!!!";
echo "