コード例 #1
0
ファイル: GDTest.php プロジェクト: bersace/strass
 function testDecouperPng2Png()
 {
     Strass_Vignette::decouper(dirname(__FILE__) . '/images/transparente.png', 'gd-png-crop.png');
 }
コード例 #2
0
ファイル: Photos.php プロジェクト: bersace/strass
 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();
 }
コード例 #3
0
ファイル: Individus.php プロジェクト: bersace/strass
 function storeImage($path)
 {
     Strass_Vignette::decouper($path, $this->getCheminImage(null, false));
 }