developer.jelix.org is not used any more and exists only for history. Post new tickets on the Github account.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Ticket #1220: jImageModifier.patch

File jImageModifier.patch, 2.2 KB (added by manoo, 10 years ago)
  • lib/jelix/utils/jImageModifier.class.php

    diff -r 9f6cc8402d6a lib/jelix/utils/jImageModifier.class.php
    a b  
    44* @subpackage utils
    55* @author      Bastien Jaillot
    66* @contributor Dominique Papin, Lepeltier kévin (the author of the original plugin)
    7 * @contributor geekbay, Brunto, Laurent Jouanneau
    8 * @copyright   2007-2008 Lepeltier kévin, 2008 Dominique Papin, 2008 Bastien Jaillot, 2009 geekbay, 2010 Brunto, 2010 Laurent Jouanneau
     7* @contributor geekbay, Brunto, Laurent Jouanneau, Emmanuel Hesry
     8* @copyright   2007-2008 Lepeltier kévin, 2008 Dominique Papin, 2008 Bastien Jaillot, 2009 geekbay, 2010 Brunto, 2010 Laurent Jouanneau, 2010 Emmanuel Hesry
    99* @link       http://www.jelix.org
    1010* @licence    GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html
    1111*/
     
    163163     * @param string image's hashname
    164164     * @param array $params parameters specifying transformations
    165165     **/
    166     static protected function transformAndCache($src, $cacheName, $params) {
     166    static public function transformAndCache($src, $cacheName, $params, $cacheDir = 'cache/images/') {
    167167
     168        if (substr($cacheDir,-1) != '/' ) {
     169            $cacheDir .= '/';
     170        }
    168171        $mimes = array('gif'=>'image/gif', 'png'=>'image/png',
    169172                       'jpeg'=>'image/jpeg', 'jpg'=>'image/jpeg', 'jpe'=>'image/jpeg',
    170173                       'xpm'=>'image/x-xpixmap', 'xbm'=>'image/x-xbitmap', 'wbmp'=>'image/vnd.wap.wbmp');
     
    173176        $srcUri = $GLOBALS['gJCoord']->request->getProtocol().$_SERVER['HTTP_HOST'];
    174177
    175178        $basePath = $gJConfig->urlengine['basePath'];
    176         $cachePath = JELIX_APP_WWW_PATH.'cache/images/'.$cacheName;
     179        $cachePath = JELIX_APP_WWW_PATH.$cacheDir.$cacheName;
    177180        if(strpos($src,$basePath) === 0) {
    178181            // in the case where the path is constructed with $j_basepath or $j_themepath
    179182            // in a template
     
    295298        }
    296299
    297300
    298         $cachePath = JELIX_APP_WWW_PATH.'cache/images/';
     301        $cachePath = JELIX_APP_WWW_PATH.$cacheDir;
    299302        jFile::createDir($cachePath);
    300303
    301304