Skip to content

Commit

Permalink
Update Imagine to latest version.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cody Lundquist committed Mar 14, 2015
1 parent 11d3717 commit 8073277
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
4 changes: 2 additions & 2 deletions src/Munee/Asset/Filter/Image/Colorize.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
11 changes: 6 additions & 5 deletions src/Munee/Asset/Filter/Image/Resize.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand All @@ -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']));
}
}
}

0 comments on commit 8073277

Please sign in to comment.