Skip to content

Commit

Permalink
implement interlace filter
Browse files Browse the repository at this point in the history
  • Loading branch information
wodka committed Sep 26, 2014
1 parent eb695e5 commit f45d5cc
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Imagine/Filter/Loader/InterlaceFilterLoader.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace Liip\ImagineBundle\Imagine\Filter\Loader;

use Imagine\Image\ImageInterface;

class InterlaceFilterLoader implements LoaderInterface
{
/**
* {@inheritDoc}
*/
public function load(ImageInterface $image, array $options = array())
{
$mode = ImageInterface::INTERLACE_LINE;
if (empty($options['mode']) {
$mode = $options['mode'];
}

$image->interlace(ImageInterface::INTERLACE_LINE);

return $image;
}
}
5 changes: 5 additions & 0 deletions Resources/config/imagine.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
<parameter key="liip_imagine.filter.loader.background.class">Liip\ImagineBundle\Imagine\Filter\Loader\BackgroundFilterLoader</parameter>
<parameter key="liip_imagine.filter.loader.upscale.class">Liip\ImagineBundle\Imagine\Filter\Loader\UpscaleFilterLoader</parameter>
<parameter key="liip_imagine.filter.loader.auto_rotate.class">Liip\ImagineBundle\Imagine\Filter\Loader\AutoRotateFilterLoader</parameter>
<parameter key="liip_imagine.filter.loader.interlace.class">Liip\ImagineBundle\Imagine\Filter\Loader\InterlaceFilterLoader</parameter>

<!-- Data loaders' classes -->

Expand Down Expand Up @@ -171,6 +172,10 @@
<tag name="liip_imagine.filter.loader" loader="auto_rotate" />
</service>

<service id="liip_imagine.filter.loader.interlace" class="%liip_imagine.filter.loader.interlace.class%">
<tag name="liip_imagine.filter.loader" loader="interlace" />
</service>

<!-- Data loaders -->

<service id="liip_imagine.binary.loader.prototype.filesystem" class="%liip_imagine.binary.loader.filesystem.class%">
Expand Down
14 changes: 14 additions & 0 deletions Resources/doc/filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,20 @@ liip_imagine:
my_thumb:
filters:
auto_rotate: ~
### The `interlace` filter

Set progressive loading on the image
Configuration looks like this:

``` yaml
liip_imagine:
filter_sets:
my_thumb:
filters:
interlace:
# mode can be one of none,line,plane,partition
mode: line
```
## Load your Custom Filters

Expand Down

0 comments on commit f45d5cc

Please sign in to comment.