コード例 #1
0
ファイル: Documents.php プロジェクト: bersace/strass
 function storeFile($tmp)
 {
     $fichier = $this->getFichier($this->_data);
     if (!file_exists($dossier = dirname($fichier))) {
         mkdir($dossier, 0755, true);
     }
     if (isset($_ENV['STRASS_UNIT_TEST'])) {
         $ret = copy($tmp, $fichier);
     } else {
         $ret = move_uploaded_file($tmp, $fichier);
     }
     if ($ret === false) {
         throw new Exception("Impossible de copier le fichier !");
     }
     $vignette = $this->getCheminVignette($this->_data);
     $load = $fichier;
     if ($this->suffixe == 'pdf') {
         $load .= '[0]';
     }
     try {
         @Strass_Vignette::reduire($load, $vignette, true);
     } catch (Exception $e) {
         /* pas supporté par Imagick */
         error_log("Échec de la vignette de " . $load . " : " . $e->getMessage());
     }
 }
コード例 #2
0
ファイル: GDTest.php プロジェクト: bersace/strass
 function testReduirePng2Png()
 {
     Strass_Vignette::reduire(dirname(__FILE__) . '/images/transparente.png', 'gd-png-mini.png');
 }
コード例 #3
0
ファイル: Unites.php プロジェクト: bersace/strass
 function storeImage($path)
 {
     Strass_Vignette::reduire($path, $this->getCheminImage(null, false));
 }