private function readImage(PlUpload $upload) { if ($upload->exists() && $upload->isType('image')) { list($this->imgx, $this->imgy, $this->imgtype) = $upload->imageInfo(); $this->img = $upload->getContents(); $upload->rm(); } }
private function read(PlUpload $upload) { $this->valid = $upload->resizeImage(240, 300, 160, 0, SIZE_MAX); if (!$this->valid) { $this->trigError('Le fichier que tu as transmis n\'est pas une image valide, ou est trop gros pour ĂȘtre traitĂ©.'); } $this->data = $upload->getContents(); list($this->x, $this->y, $this->mimetype) = $upload->imageInfo(); $upload->rm(); }