setImageFormat("jpeg"); if(isset($_REQUEST["thumb"])) { $img_w = $image->getImageWidth(); $img_h = $image->getImageHeight(); list($max_w, $max_h) = explode("x", $thumbsize); list($img_final_w, $img_final_h) = get_final_resolution($img_w, $img_h, $max_w, $max_h); $image->resizeImage($img_final_w, $img_final_h, Imagick::FILTER_MITCHELL, 0.66); $image->setCompression(Imagick::COMPRESSION_JPEG); $image->setCompressionQuality(88); } elseif($limit_size) { $img_w = $image->getImageWidth(); $img_h = $image->getImageHeight(); list($max_w, $max_h) = explode("x", $viewsize); list($img_final_w, $img_final_h) = get_final_resolution($img_w, $img_h, $max_w, $max_h); $image->resizeImage($img_final_w, $img_final_h, Imagick::FILTER_MITCHELL, 0.66); $image->setCompression(Imagick::COMPRESSION_JPEG); $image->setCompressionQuality(87); } // $size = $image->getImageSize(); // ger fel värde $size = strlen($image); header("Content-Type: image/jpeg"); header("Content-Length: " . $size); echo $image; ?>