load('img/'.$_GET['file'].'.'.$_GET['ext']); if($_GET['debug']==1) echo 'load'; $image->resize($_GET['w'],$_GET['h'],$_GET['watermark']); if($_GET['debug']==1) echo 'resize'; $image->output(); if($_GET['debug']==1) echo 'out'; $dir = explode("/",$_GET['file']); if((sizeof($dir)>1) and !file_exists('img-small/'.current($dir))) mkdir('img-small/'.current($dir)); $image->save('img-small/'.$_GET['file'].'-'.$_GET['w'].'x'.$_GET['h'].(($_GET['watermark']!='')?"_".$_GET['watermark']:"").'.'.$_GET['ext']); if($_GET['debug']==1) echo 'save'; if(filesize('img-small/'.$_GET['file'].'-'.$_GET['w'].'x'.$_GET['h'].(($_GET['watermark']!='')?"_".$_GET['watermark']:"").'.'.$_GET['ext'])==0) { header('Location: /images/no_image.jpg');; //treba da ja izbrise od baza slikata } exit(); //readfile('images/noImageAvailable.jpg'); } ?>