Subversion Repositories eFlore/Applications.cel

Rev

Rev 3459 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3459 Rev 3460
Line 371... Line 371...
371
	public function obtenirImageEtInfosPourChemin($chemin_fichier) {
371
	public function obtenirImageEtInfosPourChemin($chemin_fichier) {
372
		$image_et_infos = false;
372
		$image_et_infos = false;
Line 373... Line 373...
373
 
373
 
374
		if (file_exists($chemin_fichier)) {
374
		if (file_exists($chemin_fichier)) {
375
			$image_et_infos = array();
375
			$image_et_infos = array();
376
			list($image_et_infos['largeur'], $image_et_infos['hauteur'], $image_et_infos['imagetype']) = getimagesize($chemin_fichier);
376
			list($image_et_infos['largeur'], $image_et_infos['hauteur']) = getimagesize($chemin_fichier);
-
 
377
			$image_et_infos['poids_octets'] = filesize($chemin_fichier);
377
			$image_et_infos['poids_octets'] = filesize($chemin_fichier);
378
			$image_et_infos['image'] = imagecreatefromjpeg($chemin_fichier);
378
			$image_et_infos['chemin'] = $chemin_fichier;
-
 
379
 
-
 
380
			switch (image_type_to_mime_type($image_et_infos['imagetype'])) {
-
 
381
				case 'image/jpeg':
-
 
382
					$image_et_infos['image'] = imagecreatefromjpeg($chemin_fichier);
-
 
383
					break;
-
 
384
				case 'image/png':
-
 
385
					$image_et_infos['image'] = imagecreatefrompng($chemin_fichier);
-
 
386
					break;
-
 
387
				default:
-
 
388
					// ni jpeg ni png donc pas supporté, ça dégage
-
 
389
					return false;
-
 
390
			}
379
			$image_et_infos['chemin'] = $chemin_fichier;
Line 391... Line 380...
391
		}
380
		}
392
 
381