Rev 2131 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<?php
class CelImageFormat extends Cel {
/**
* Méthode appelée avec une requête de type GET.
*/
public function getElement($params) {
$id = ltrim($params[0],'0');
$format = isset($_GET['format']) ? $_GET['format'] : 'M';
$gestion_formats_images = new ImageRecreation($this->config);
$image_binaire = $gestion_formats_images->creerOuRenvoyerImage($params[0], $format);
if($image_binaire) {
header('Content-Type: image/jpeg');
echo $image_binaire;
exit;
} else {
header("HTTP/1.0 404 Not Found");
}
}
}