- global $globals, $page;
-
- $this->Validate($_uid, true, 'photo', $_stamp);
-
- // calcul de la taille de l'image
- require_once('xorg.varstream.inc.php');
- $GLOBALS['photoreq'] = $_data;
- $image_infos = getimagesize('var://photoreq');
- unset ($GLOBALS['photoreq']);
-
- if (empty($image_infos)) {
- $page->trig("Image invalide");
- return ($this = null);
- }
- list($this->x, $this->y, $this->mimetype) = $image_infos;
-
- switch ($this->mimetype) {
- case 1: $this->mimetype = "gif"; break;
- case 2: $this->mimetype = "jpeg"; break;
- case 3: $this->mimetype = "png"; break;
- default:
- $page->trig("Type d'image invalide");
- return ($this = null);
- }
+ parent::__construct($_uid, true, 'photo', $_stamp);
+ $this->read($upload);
+ }