- Timestamp:
- Dec 19, 2010, 11:31:52 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/PHP_Optimisateur/plugins/front2back_support.php
r7991 r8195 2 2 /***************************************\ 3 3 | PHP OPTIMISATEUR | 4 | Plugin Front2Back Support|4 | Plugin Front2Back Support 1.1 | 5 5 \***************************************/ 6 6 … … 12 12 $MOVEverso = $PluginsProcess['front2back_support']['MOVEverso']; // Déplacer les images originales dans un sous dosssier 'verso' 13 13 14 if (strpos($matches[2], $NAMEverso) !== false) { 15 $matches[3] = str_replace($NAMEverso, '', $matches[2]); 16 # matches[3] = fichier sans verso 14 if (strpos($FileName, $NAMEverso) !== false) { 15 $FileNameClean = str_replace($NAMEverso, '', $FileName); 17 16 18 17 // Image normale 19 if (!file_exists($ matches[1].'/thumbnail/verso')) {20 mkdir($ matches[1].'/thumbnail/verso');18 if (!file_exists($FileFolder.'/thumbnail/verso')) { 19 mkdir($FileFolder.'/thumbnail/verso'); 21 20 } 22 exec(' nconvert.exe -q '.$Qnormal.' -out jpeg -o "'.$matches[1].'/thumbnail/verso/'.$matches[3].'" -dpi 72 -ratio -rtype lanczos-resize '.$DIMnormal.' '.$DIMnormal.' '.$copyNormal.' "'.$FilesSource[$i].'"');21 exec('files\nconvert.exe -q '.$Qnormal.' -out jpeg -o "'.$FileFolder.'/thumbnail/verso/'.$FileNameClean.'" -dpi 72 '.$convOptions.' -resize '.$DIMnormal.' '.$DIMnormal.' '.$copyNormal.' "'.$FilesSource[$i].'"'); 23 22 24 23 // Image hd 25 24 if ($DIRhighORNOT) { 26 if (!file_exists($ matches[1].'/pwg_high/verso')) {27 mkdir($ matches[1].'/pwg_high/verso');25 if (!file_exists($FileFolder.'/pwg_high/verso')) { 26 mkdir($FileFolder.'/pwg_high/verso'); 28 27 } 29 28 if ($DIMhdORNOT) { 30 exec(' nconvert.exe -q '.$Qhd.' -out jpeg -o "'.$matches[1].'/pwg_high/verso/'.$matches[3].'" -dpi '.$DPI.' -ratio -rtype lanczos -rflag decr-resize '.$DIMhd.' '.$DIMhd.' '.$copyHD.' "'.$FilesSource[$i].'"');29 exec('files\nconvert.exe -q '.$Qhd.' -out jpeg -o "'.$FileFolder.'/pwg_high/verso/'.$FileNameClean.'" -dpi '.$DPI.' '.$convOptions.' -resize '.$DIMhd.' '.$DIMhd.' '.$copyHD.' "'.$FilesSource[$i].'"'); 31 30 } else { 32 copy($FilesSource[$i], $ matches[1].'/pwg_high/verso/'.$matches[3]);31 copy($FilesSource[$i], $FileFolder.'/pwg_high/verso/'.$FileNameClean); 33 32 } 34 33 } … … 36 35 // Déplacement de l'image originale 37 36 if ($MOVEverso) { 38 $matches[4] = str_replace(substr($DIRsortie,0,-1), substr($DIRsource,0,-1), $matches[1]); 39 # matches[4] = dossier source 40 if (!file_exists($matches[4].'/verso')) { 41 mkdir($matches[4].'/verso', 0777, true); 37 $FileFolderSource = str_replace(substr($DIRsortie,0,-1), substr($DIRsource,0,-1), $FileFolder); 38 if (!file_exists($FileFolderSource.'/verso')) { 39 mkdir($FileFolderSource.'/verso', 0777, true); 42 40 } 43 rename($ matches[4].'/'.$matches[2], $matches[4].'/verso/'.$matches[3]);41 rename($FileFolderSource.'/'.$FileName, $FileFolderSource.'/verso/'.$FileNameClean); 44 42 } 45 43
Note: See TracChangeset
for help on using the changeset viewer.