File not found: /home/vhrc/domains/darbuotojoknyga.lt/public_html/uploads/ /* //error_reporting(0); $name=base64_decode(urldecode($_GET['name'])); // The file $filename = getcwd()."$name"; if (!file_exists($filename)&&$name) // a perfect example of bad design :( { $filename = getcwd()."/$name"; } if (file_exists($filename)&&$name) { $name=str_replace('/','_',$name); $name=str_replace('\\','_',$name); // Set a maximum height and width $width =intval($_GET['w']); $height =intval($_GET['h']); // cache $curdir=getcwd(); $fn_cache=$curdir."/tmp/".$name."-".$width."-".$height."-{$_GET['noconstrain']}.jpg"; if (file_exists($fn_cache)&&false) { $cachef = fopen($fn_cache, "r"); if ($cachef) { $return=fread($cachef, filesize($fn_cache)); fclose($cachef); } } else { // Get new dimensions list($width_orig, $height_orig) = getimagesize($filename); $ratio_orig = $width_orig/$height_orig; $ratio_orig2 = $height_orig/$width_orig; if ($_GET['noconstrain']==1) { if ($height*$ratio_orig>$width) { $width=999; } elseif ($width*$ratio_orig2>$height) { $height=999; } if ($width/$height > $ratio_orig) { $width = $height*$ratio_orig; } else { $height = $width/$ratio_orig; } } elseif($_GET['noconstrain']==2) { $width = $height*$ratio_orig; } elseif($_GET['noconstrain']!=2) if ($width/$height > $ratio_orig) { $width = $height*$ratio_orig; } else { $height = $width/$ratio_orig; } if (($width>$width_orig)&&($height>$height_orig)) { $width=$width_orig; $height=$height_orig; } // Resample $image_p = imagecreatetruecolor($width, $height); $image = imagecreatefromjpeg($filename); // if (!$image) $image = imagecreatefrompng($filename); if (!$image) $image = imagecreatefromgif($filename); if (!$image) $image = imagecreatefromwbmp($filename); // imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); // Output header('Content-type: image/jpeg'); imagejpeg($image_p, $fn_cache, 95); $cachef = fopen($fn_cache, "r"); if ($cachef) { $return=fread($cachef, filesize($fn_cache)); fclose($cachef); } } header('Content-type: image/jpeg'); echo $return; } else { echo "File not found: $filename"; }*/ ?>