function storeFile($path) { $activite = $this->findParentActivites(); /* date */ $exif = @exif_read_data($path); if ($exif && array_key_exists('DateTimeOriginal', $exif)) { preg_match("`(\\d{4})[:-](\\d{2})[:-](\\d{2}) (\\d{2}):(\\d{2}):(\\d{2})`", $exif['DateTimeOriginal'], $match); $this->date = $match[1] . '-' . $match[2] . '-' . $match[3] . ' ' . $match[4] . ':' . $match[5] . ':' . $match[6]; } else { $this->date = $activite->fin; } $dossier = $activite->getDossierPhoto(); if (!file_exists($dossier)) { mkdir($dossier, 0755, true); } $suffixe = '.jpeg'; $vignette = $dossier . '/' . $this->slug . '-vignette' . $suffixe; $fichier = $dossier . '/' . $this->slug . $suffixe; $config = Zend_Registry::get('config'); $photo = Strass_Vignette::charger($path, $fichier, true); $width = $photo->getWidth(); $height = $photo->getHeight(); $MAX = $config->get('photo/taille', 2048); if (min($width, $height) > $MAX) { $photo->scale($MAX, $MAX); } $photo->ecrire(); Strass_Vignette::decouper($photo, $vignette); $this->save(); }