diff --git a/composer.json b/composer.json index 94183a3..bd37457 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "leafo/lessphp": "0.5.0", "leafo/scssphp": "0.1.1", "tedivm/jshrink": "1.0.1", - "imagine/Imagine": "0.5.0", + "imagine/imagine": "0.6.2", "coffeescript/coffeescript": "1.3.1", "meenie/javascript-packer": "1.1" }, diff --git a/src/Munee/Asset/Filter/Image/Colorize.php b/src/Munee/Asset/Filter/Image/Colorize.php index 390146a..640e192 100644 --- a/src/Munee/Asset/Filter/Image/Colorize.php +++ b/src/Munee/Asset/Filter/Image/Colorize.php @@ -44,8 +44,8 @@ public function doFilter($file, $arguments, $typeOptions) { $Imagine = new Imagine(); $image = $Imagine->open($file); - $colour = new Color('#' . $arguments['colorize']); + $colour = $image->palette()->color('#' . $arguments['colorize']); $image->effects()->colorize($colour); $image->save($file); } -} \ No newline at end of file +} diff --git a/src/Munee/Asset/Filter/Image/Resize.php b/src/Munee/Asset/Filter/Image/Resize.php index 6c78bbc..c598b3e 100644 --- a/src/Munee/Asset/Filter/Image/Resize.php +++ b/src/Munee/Asset/Filter/Image/Resize.php @@ -12,7 +12,7 @@ use Munee\ErrorException; use Imagine\Image\ImageInterface; use Imagine\Image\Box; -use Imagine\Image\Color; +use Imagine\Image\Palette\RGB; use Imagine\Image\Point; /** @@ -41,7 +41,7 @@ class Resize extends Filter 'cast' => 'integer' ), 'quality' => array( - 'alias' => array('q', 'qlty'), + 'alias' => array('q', 'qlty', 'jpeg_quality'), 'regex' => '\d{1,2}(?!\d)|100', 'default' => 75, 'cast' => 'integer' @@ -165,9 +165,10 @@ public function doFilter($originalImage, $arguments, $imageOptions) $canvasHeight = $imageOptions['maxAllowedResizeHeight']; } + $palette = new RGB(); $canvas = $Imagine->create( new Box($canvasWidth, $canvasHeight), - new Color($arguments['fillColour']) + $palette->color($arguments['fillColour']) ); // Put image in the middle of the canvas @@ -177,6 +178,6 @@ public function doFilter($originalImage, $arguments, $imageOptions) )); } - $newImage->save($originalImage, array('quality' => $arguments['quality'])); + $newImage->save($originalImage, array('jpeg_quality' => $arguments['quality'])); } -} \ No newline at end of file +}