From 5cef962632991382adc0bd0d71f244840bf07862 Mon Sep 17 00:00:00 2001 From: Alexey Sukhotin <667bdrm@gmail.com> Date: Sun, 18 Sep 2011 21:05:12 -0700 Subject: [PATCH 1/4] Fixed ImageMagick color palette when doing resize or thumbnail generation --- php/elFinderVolumeDriver.class.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/php/elFinderVolumeDriver.class.php b/php/elFinderVolumeDriver.class.php index ca699161e..1bef1c890 100644 --- a/php/elFinderVolumeDriver.class.php +++ b/php/elFinderVolumeDriver.class.php @@ -2574,8 +2574,7 @@ abstract class elFinderVolumeDriver { return false; } - $img->contrastImage(1); - $img->resizeImage($size_w, $size_h, NULL, true); + $img->resizeImage($size_w, $size_h, Imagick::FILTER_LANCZOS, true); $result = $img->writeImage($path); @@ -2730,10 +2729,9 @@ abstract class elFinderVolumeDriver { return false; } - $img->contrastImage(1); - $img1 = new Imagick(); $img1->newImage($width, $height, new ImagickPixel($bgcolor)); + $img1->setImageColorspace($img->getImageColorspace()); $img1->setImageFormat($destformat != null ? $destformat : $img->getFormat()); $img1->compositeImage( $img, imagick::COMPOSITE_OVER, $x, $y ); $result = $img1->writeImage($path); From 75a8f3d49e3de48ff913f9ccd0e701f30a398339 Mon Sep 17 00:00:00 2001 From: Alexey Sukhotin <667bdrm@gmail.com> Date: Sun, 18 Sep 2011 21:28:22 -0700 Subject: [PATCH 2/4] Fixed ImageMagick color palette when performing crop operation --- php/elFinderVolumeDriver.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/php/elFinderVolumeDriver.class.php b/php/elFinderVolumeDriver.class.php index 1bef1c890..8a1538d8d 100644 --- a/php/elFinderVolumeDriver.class.php +++ b/php/elFinderVolumeDriver.class.php @@ -2648,7 +2648,6 @@ abstract class elFinderVolumeDriver { return false; } - $img->contrastImage(1); $img->cropImage($width, $height, $x, $y); $result = $img->writeImage($path); From 915a7f15c732ef5ce1d6ae3c270a62f7ffd074cf Mon Sep 17 00:00:00 2001 From: Alexey Sukhotin <667bdrm@gmail.com> Date: Sun, 18 Sep 2011 22:20:04 -0700 Subject: [PATCH 3/4] Fixed default resize mode when no mode selected --- php/elFinderVolumeDriver.class.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/php/elFinderVolumeDriver.class.php b/php/elFinderVolumeDriver.class.php index 8a1538d8d..4f25b0f9b 100644 --- a/php/elFinderVolumeDriver.class.php +++ b/php/elFinderVolumeDriver.class.php @@ -1581,7 +1581,7 @@ abstract class elFinderVolumeDriver { * @author Alexey Sukhotin **/ public function resize($hash, $width, $height, $x, $y, $mode = 'resize') { - if ($this->commandDisabled('archive')) { + if ($this->commandDisabled('resize')) { return $this->setError(elFinder::ERROR_PERM_DENIED); } @@ -1600,9 +1600,6 @@ abstract class elFinderVolumeDriver { } switch($mode) { - case 'resize': - return $this->imgResize($path, $width, $height, false, true, $this->imgLib) ? $this->stat($path) : false; - break; case 'propresize': return $this->imgResize($path, $width, $height, true, true, $this->imgLib) ? $this->stat($path) : false; @@ -1615,7 +1612,12 @@ abstract class elFinderVolumeDriver { case 'fitsquare': return $this->imgSquareFit($path, $width, $height, 'center', 'middle', $this->options['tmbBgColor'], $this->imgLib) ? $this->stat($path) : false; break; + + default: + return $this->imgResize($path, $width, $height, false, true, $this->imgLib) ? $this->stat($path) : false; + break; } + return false; } @@ -2614,7 +2616,7 @@ abstract class elFinderVolumeDriver { } break; } - + return false; } From 0c333e71407c4731604a6e794a739674531f282b Mon Sep 17 00:00:00 2001 From: Troex Nevelin Date: Thu, 22 Sep 2011 22:17:17 +0300 Subject: [PATCH 4/4] remove forced library inclusion --- Jakefile.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Jakefile.js b/Jakefile.js index 982a64cf2..e93d147b3 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -5,9 +5,7 @@ * CSS optimizer: https://github.com/afelix/csso */ -// does anyone know how to overcome this problem? -require.paths.push('/usr/local/lib/node_modules'); // for common linux install -require.paths.push('/opt/local/lib/node_modules'); // for Mac OS X macports install +// if Jake fails to detect need libraries try running before: export NODE_PATH=`npm root` var sys = require('sys'), fs = require('fs'), @@ -29,7 +27,6 @@ var dirmode = 0755, path.join(src, 'js', 'elFinder.history.js'), path.join(src, 'js', 'elFinder.command.js'), path.join(src, 'js', 'elFinder.resources.js'), - //path.join(src, 'js', 'elFinder.contextmenu.js'), path.join(src, 'js', 'jquery.dialogelfinder.js'), path.join(src, 'js', 'i18n', 'elfinder.en.js') ]