Subversion Repositories eFlore/Applications.cel

Rev

Rev 672 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 672 Rev 970
Line 12... Line 12...
12
	public function __construct($config) {
12
	public function __construct($config) {
13
		$this->config = $config;
13
		$this->config = $config;
14
		$this->mode = self::MODE_GD;
14
		$this->mode = self::MODE_GD;
Line 15... Line 15...
15
		
15
		
16
		if (extension_loaded('imagick')) {
16
		if (extension_loaded('imagick')) {
17
			putenv('MAGICK_TEMPORARY_PATH='.$this->config['cel_db']['chemin_stockage_temp']);
17
			putenv('MAGICK_TEMPORARY_PATH='.$this->config['cel']['chemin_stockage_temp']);
18
			$this->mode = self::MODE_IMAGEMAGICK;
18
			$this->mode = self::MODE_IMAGEMAGICK;
19
		}
19
		}
Line 20... Line 20...
20
	}
20
	}
21
	
21
	
22
	public function recreerMiniaturesRecursivement() {
22
	public function recreerMiniaturesRecursivement() {
Line 23... Line 23...
23
		$this->itererRecursivement($this->config['cel_db']['chemin_images']);
23
		$this->itererRecursivement($this->config['cel']['chemin_images']);
24
	}
24
	}
25
	
25
	
Line 290... Line 290...
290
		
290
		
291
		return $chemin_sur_serveur_final;
291
		return $chemin_sur_serveur_final;
Line 292... Line 292...
292
	}
292
	}
293
	
293
	
Line 294... Line 294...
294
	public function obtenirDossierPourFormat($id, $format) {
294
	public function obtenirDossierPourFormat($id, $format) {
Line 295... Line 295...
295
		$chemin_base = $this->config['cel_db']['chemin_images'];
295
		$chemin_base = $this->config['cel']['chemin_images'];
296
	
296
	
Line 333... Line 333...
333
	}
333
	}
Line 334... Line 334...
334
	
334
	
335
	public function obtenirDimensionsPourFormat($format) {
335
	public function obtenirDimensionsPourFormat($format) {
Line 336... Line 336...
336
		$dimensions = array('largeur' => 0, 'hauteur' => 0);
336
		$dimensions = array('largeur' => 0, 'hauteur' => 0);
337
		
337
		
338
		if (isset($this->config['cel_db']['format_'.$format])) {
338
		if (isset($this->config['cel']['format_'.$format])) {
Line 339... Line 339...
339
			list($dimensions['largeur'], $dimensions['hauteur']) = explode('_', $this->config['cel_db']['format_'.$format]);
339
			list($dimensions['largeur'], $dimensions['hauteur']) = explode('_', $this->config['cel']['format_'.$format]);
340
		}
340
		}
Line 378... Line 378...
378
	public function estPortait($informations_images) {
378
	public function estPortait($informations_images) {
379
		return $informations_images['largeur'] < $informations_images['hauteur'];
379
		return $informations_images['largeur'] < $informations_images['hauteur'];
380
	}
380
	}
Line 381... Line 381...
381
	
381
	
382
	public function renvoyerTauxCompressionPourPoids($poids_octets) {
382
	public function renvoyerTauxCompressionPourPoids($poids_octets) {
Line 383... Line 383...
383
		$poids_max_octets = $this->config['cel_db']['taille_max'];
383
		$poids_max_octets = $this->config['cel']['taille_max'];
Line 384... Line 384...
384
		
384
		
385
		$ratio_compression = 100 ;
385
		$ratio_compression = 100 ;
Line 493... Line 493...
493
		umask(0);
493
		umask(0);
Line 494... Line 494...
494
		
494
		
495
		$nom_temp = md5(time());
495
		$nom_temp = md5(time());
Line 496... Line 496...
496
		$chemin_temp = 
496
		$chemin_temp = 
Line 497... Line 497...
497
		
497
		
Line 498... Line 498...
498
		$out = $this->config['cel_db']['chemin_stockage_temp'].'/'.$nom_temp;
498
		$out = $this->config['cel']['chemin_stockage_temp'].'/'.$nom_temp;
499
		
499