Subversion Repositories eFlore/Applications.cel

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2083 aurelien 1
<?php
2
class CelImageFormat extends Cel {
3
 
4
	/**
5
	* Méthode appelée avec une requête de type GET.
6
	*/
7
	public function getElement($params) {
8
		$id = ltrim($params[0],'0');
9
		$format = isset($_GET['format']) ? $_GET['format'] : 'M';
10
 
11
		$gestion_formats_images = new ImageRecreation($this->config);
12
		$image_binaire = $gestion_formats_images->creerOuRenvoyerImage($params[0], $format);
13
 
14
		if($image_binaire) {
15
			header('Content-Type: image/jpeg');
16
			echo $image_binaire;
17
			exit;
18
		} else {
19
			header("HTTP/1.0 404 Not Found");
20
		}
21
	}
22
}