Subversion Repositories eFlore/Applications.cel

Rev

Rev 661 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
661 aurelien 1
<?php
2
 
3
Class imageProvider extends Cel {
4
 
5
	function getElement($uid){
6
 
7
		if(!isset($uid[0])) {
8
			return;
9
		}
10
 
11
		$id_image = $uid[0];
12
 
13
		$format = 'temp';
14
 
15
		if(isset($_GET['format'])) {
16
			$format = $_GET['format'];
17
		}
18
 
19
		if(isset($_GET['dimensions'])) {
20
			$dimensions = $_GET['dimensions'];
21
		} else {
22
			if(isset($this->config['cel_db']['format_'.$format])) {
23
				$dimensions = $this->config['cel_db']['format_'.$format];
24
			}
25
		}
26
 
27
		$this->config['cel_db']['format_'.$format] = $dimensions;
28
 
29
		$generateur_image = new ImageRecreation($this->config);
30
 
31
		$infos_image = $generateur_image->obtenirImageEtInfosPourId($id_image);
32
 
33
		if(!$infos_image) {
34
			header('HTTP/1.0 404 Not Found');
35
			exit;
36
		}
37
 
38
		$image_generee = $generateur_image->creerMiniatureImageSelonFormat($infos_image, $format);
39
 
40
		header('Content-type: image/jpeg');
41
		imagejpeg($image_generee);
42
		exit;
43
 
44
	}
45
 
46
	private function estUneImageALaDemande() {
47
 
48
	}
49
 
50
}
51
 
52
?>