extranet/www/imagescores.php
2009-09-14 16:49:09 +00:00

20 lines
549 B
PHP

<?php
// File and new size
$filename = PATH_WWW.'img/degrade.png';
isset($_REQUEST['q'])? $percent = $_REQUEST['q'] : $percent = 0;
$percent = $percent/100;
// Get new dimensions
list($width, $height) = getimagesize($filename);
$new_width = $width * $percent;
$new_height = $height;
// Déclaration de la nouvelle image
$image = new Imagick($filename);
// Découper l'image
$image->cropImage($new_width, $new_height, 0, 0);
$image->setImageFormat('png');
/* Affichage de l'image avec les entêtes */
header('Content-type: image/png');
echo $image;
?>