Ignore:
Timestamp:
Dec 19, 2010, 11:31:52 AM (13 years ago)
Author:
mistic100
Message:
  • Nouveau plugin : CreateCustomThumbs permet de créer des miniatures de taille fixe
  • On peut maintenant désinstaller un plugin facilement
  • Ajout d’une option pour gérer le dossier de sortie non vide (effacer, continuer, bloquer)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/PHP_Optimisateur/plugins/front2back_support.php

    r7991 r8195  
    22/***************************************\
    33|                       PHP OPTIMISATEUR                        |
    4 |               Plugin Front2Back Support               |
     4|         Plugin Front2Back Support 1.1         |
    55\***************************************/
    66
     
    1212$MOVEverso = $PluginsProcess['front2back_support']['MOVEverso']; // Déplacer les images originales dans un sous dosssier 'verso'
    1313
    14 if (strpos($matches[2], $NAMEverso) !== false) {
    15         $matches[3] = str_replace($NAMEverso, '', $matches[2]);
    16         # matches[3] = fichier sans verso
     14if (strpos($FileName, $NAMEverso) !== false) {
     15        $FileNameClean = str_replace($NAMEverso, '', $FileName);
    1716       
    1817        // 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');
    2120        }
    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].'"');
    2322       
    2423        // Image hd
    2524        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');
    2827                }
    2928                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].'"');
    3130                } else {
    32                         copy($FilesSource[$i], $matches[1].'/pwg_high/verso/'.$matches[3]);
     31                        copy($FilesSource[$i], $FileFolder.'/pwg_high/verso/'.$FileNameClean);
    3332                }
    3433        }
     
    3635        // Déplacement de l'image originale
    3736        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);
    4240                }
    43                 rename($matches[4].'/'.$matches[2], $matches[4].'/verso/'.$matches[3]);
     41                rename($FileFolderSource.'/'.$FileName, $FileFolderSource.'/verso/'.$FileNameClean);
    4442        }
    4543       
Note: See TracChangeset for help on using the changeset viewer.