Skip to content

Commit

Permalink
Consolidate documentation and add license
Browse files Browse the repository at this point in the history
  • Loading branch information
jmikola committed Feb 11, 2012
1 parent 557b318 commit f1f4f84
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 105 deletions.
18 changes: 18 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Copyright (c) 2012 Jeremy Mikola

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
59 changes: 56 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,63 @@ This bundle provides a RelativeResize filter for [Imagine][] and a corresponding
loader for use with [AvalancheImagineBundle][]. It also provides a loader for
the basic Resize filter.

## Documentation
## Configuration

This bundle's documentation lives in [Resources/doc/index.md][].
There are no configuration options. Symfony2 will load the bundle's dependency
injection extension automatically.

Tagged filter loaders will be picked up by AvalancheImagineBundle's compiler
pass and made available for use in its configuration.

## Filters

### Resize

The `resize` filter may be used to simply change the width and height of an
image irrespective of its proportions.

Consider the following configuration example, which defines two filters to alter
an image to an exact screen resolution:

``` yaml
avalanche_imagine:
filters:
cga:
type: resize
options: { size: [320, 200] }
wuxga:
type: resize
options: { size: [1920, 1200] }
```
### RelativeResize
The `relative_resize` filter may be used to `heighten`, `widen`, `increase` or
`scale` an image with respect to its existing dimensions. These options directly
correspond to methods on Imagine's `BoxInterface`.

Given an input image sized 50x40 (width, height), consider the following
annotated configuration examples:

``` yaml
avalanche_imagine:
filters:
heighten:
type: relative_resize
options: { heighten: 60 } # Transforms 50x40 to 75x60
widen:
type: relative_resize
options: { widen: 32 } # Transforms 50x40 to 40x32
increase:
type: relative_resize
options: { increase: 10 } # Transforms 50x40 to 60x50
scale:
type: relative_resize
options: { scale: 2.5 } # Transforms 50x40 to 125x100
```

If you prefer using Imagine without a filter configuration, the `RelativeResize`
class may be used directly.

[Imagine]: https://github.com/avalanche123/Imagine
[AvalancheImagineBundle]: https://github.com/avalanche123/AvalancheImagineBundle
[Resources/doc/index.md]: https://github.com/jmikola/JmikolaImagineBundle/blob/master/Resources/doc/index.md
102 changes: 0 additions & 102 deletions Resources/doc/index.md

This file was deleted.

0 comments on commit f1f4f84

Please sign in to comment.