1 | <?php |
---|
2 | /***************************************\ |
---|
3 | | PHP OPTIMISATEUR | |
---|
4 | | Plugin Front2Back Support 1.1 | |
---|
5 | \***************************************/ |
---|
6 | |
---|
7 | ## Déplace les versions alternatives dans 'thumbnail/verso' |
---|
8 | ## Crée la version alternative hd dans 'pwg_high/verso' |
---|
9 | ## Supprime le suffixe et déplace aussi les fichiers du repertoire source |
---|
10 | |
---|
11 | $NAMEverso = $CONF['Plugins']['front2back_support']['NAMEverso']; // Suffixe des versions alternatives |
---|
12 | $MOVEverso = $CONF['Plugins']['front2back_support']['MOVEverso']; // Déplacer les images originales dans un sous dosssier 'verso' |
---|
13 | |
---|
14 | if (strpos($FileName, $NAMEverso) !== false) { |
---|
15 | $FileNameClean = str_replace($NAMEverso, '', $FileName); |
---|
16 | |
---|
17 | // Image normale |
---|
18 | if (!file_exists($FileFolder.'thumbnail/verso')) { |
---|
19 | mkdir($FileFolder.'thumbnail/verso'); |
---|
20 | } |
---|
21 | exec('files\nconvert.exe -q '.$CONF['Qnormal'].' -out jpeg -o "'.$FileFolder.'thumbnail/verso/'.$FileNameClean.'" -dpi 72 '.$CONF['convOptions'].' -resize '.$CONF['DIMnormal'].' '.$CONF['DIMnormal'].' '.$CONF['copyNormal'].' "'.$FilesSource[$i].'"'); |
---|
22 | |
---|
23 | // Image hd |
---|
24 | if ($CONF['DIRhighORNOT']) { |
---|
25 | if (!file_exists($FileFolder.'pwg_high/verso')) { |
---|
26 | mkdir($FileFolder.'pwg_high/verso'); |
---|
27 | } |
---|
28 | if ($CONF['DIMhdORNOT']) { |
---|
29 | exec('files\nconvert.exe -q '.$CONF['Qhd'].' -out jpeg -o "'.$FileFolder.'pwg_high/verso/'.$FileNameClean.'" -dpi '.$CONF['DPI'].' '.$CONF['convOptions'].' -resize '.$CONF['DIMhd'].' '.$CONF['DIMhd'].' '.$CONF['copyHD'].' "'.$FilesSource[$i].'"'); |
---|
30 | } else { |
---|
31 | copy($FilesSource[$i], $FileFolder.'pwg_high/verso/'.$FileNameClean); |
---|
32 | } |
---|
33 | } |
---|
34 | |
---|
35 | // Déplacement de l'image originale |
---|
36 | if ($MOVEverso) { |
---|
37 | $FileFolderSource = str_replace($CONF['DIRsortie'], $CONF['DIRsource'], $FileFolder); |
---|
38 | if (!file_exists($FileFolderSource.'verso')) { |
---|
39 | mkdir($FileFolderSource.'verso', 0777, true); |
---|
40 | } |
---|
41 | rename($FileFolderSource.$FileName, $FileFolderSource.'verso/'.$FileNameClean); |
---|
42 | } |
---|
43 | |
---|
44 | $BlockNormal = true; |
---|
45 | $BlockThumbnail = true; |
---|
46 | $BlockHigh = true; |
---|
47 | } |
---|
48 | ?> |
---|