Rev 661 | Rev 903 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<?php
// ATTENTION ! Classe compatible uniquement avec nouveau format de bdd du cel //
/**
* PHP Version 5
*
* @category PHP
* @package papyrus_bp
* @author aurelien <aurelien@tela-botanica.org>
* @copyright 2010 Tela-Botanica
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @version SVN: <svn_id>
* @link /doc/papyrus_bp/
*/
/**
* Classe fournissant des images au format demandé ou bien aux dimensions demandées
*
* in=utf8
* out=utf8
*
*/
class imageProvider extends Cel {
function getElement($uid){
if(!isset($uid[0])) {
return;
}
$id_image = $uid[0];
$format = 'temp';
if(isset($_GET['format'])) {
$format = $_GET['format'];
}
if(isset($_GET['dimensions'])) {
$dimensions = $_GET['dimensions'];
} else {
if(isset($this->config['cel_db']['format_'.$format])) {
$dimensions = $this->config['cel_db']['format_'.$format];
}
}
$this->config['cel_db']['format_'.$format] = $dimensions;
$generateur_image = new ImageRecreation($this->config);
$infos_image = $generateur_image->obtenirImageEtInfosPourId($id_image);
if(!$infos_image) {
header('HTTP/1.0 404 Not Found');
exit;
}
$image_generee = $generateur_image->creerMiniatureImageSelonFormat($infos_image, $format);
header('Content-type: image/jpeg');
imagejpeg($image_generee);
exit;
}
private function estUneImageALaDemande() {
}
}
?>