";
echo "width:".$width."
";
echo "height:".$height."
";
echo "dynamic_width:".$dynamic_width."
";
echo "dynamic_heigth:".$dynamic_height."
";
echo "picturePath:".$picture_path."
";
list($usec, $sec) = explode(' ', microtime());
$script_start= (float) $sec + (float) $usec;
}
if($missing_size){
die("pictureUrl parameter missing");
//@todo: in a next version ,let it go ? (see test below)
}
if (extension_loaded('imagick')) {
$image = new Imagick($picture_path);
if(! $missing_size){
$image->adaptiveResizeImage($dynamic_width,$dynamic_height);
}
$image->setCompression(Imagick::COMPRESSION_JPEG);
$image->setCompressionQuality(80);
$image->setImageFormat('jpeg');
$size = $image->getImageLength();
}else{
//todo echo "Imagick not loaded, please check your server or contact your hosting service";
//try alternate method using GD
}
if(!$debug){
header('Content-type: image/jpeg');
//header('Content-Length:'.$image->getImageSize());
header('Content-Transfer-Encoding :binary');
echo $image;
}else{
echo 'imageSize:'.$size.'
';
echo 'compression;'.$image->getCompression();
echo 'compressionq:'.$image->getCompressionQuality();
list($usec, $sec) = explode(' ', microtime());
$script_end = (float) $sec + (float) $usec;
$elapsed_time = round($script_end - $script_start, 5);
if($missing_size){
echo "No resize data. Please check that cookie has been set. Image NOT resized, computed in ".$elapsed_time." s
";
}else{
echo "Image resized and computed in ".$elapsed_time." s
";
}
}
?>