Skip to content

Commit 5e97e8c

Browse files
committed
:octocat:
1 parent 71cbb7a commit 5e97e8c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,15 @@ $options = new ImagetilerOptions([
6868
'zoom_normalize' => 6,
6969
'fill_color' => 'transparent',
7070
'fast_resize' => true,
71+
'optimize_output' => true,
7172
// ... whatever you need
7273
]);
7374

75+
// see https://github.com/psliwa/image-optimizer#configuration
76+
$optimizer = (new OptimizerFactory([]))->get();
77+
7478
// invoke and run the tiler
75-
$tiler = new Imagetiler($options);
79+
$tiler = new Imagetiler($options, $optimizer);
7680
$tiler->process('/path/to/image.png', '/path/to/output/');
7781
```
7882

@@ -85,6 +89,7 @@ method | return | description
8589
------ | ------ | -----------
8690
`__construct(ContainerInterface $options = null, LoggerInterface $logger = null)` | - | see [`ContainerInterface`](https://github.com/chillerlan/php-traits/blob/master/src/ContainerInterface.php) and [`LoggerInterface`](https://github.com/php-fig/log). Invokes an empty `ImagetilerOptions` object and a `Psr\NullLogger` if the respective parameters aren't set.
8791
`setOptions(ContainerInterface $options)` | `Imagetiler` | set options on-the-fly, called internally by the constructor
92+
`setOptimizer(Optimizer $optimizer)` | `Imagetiler` | set an optimizer instance on-the-fly, called internally by the constructor
8893
`process(string $image_path, string $out_path)` | `Imagetiler` | processes the given image from `$image_path` and dumps the output to `$out_path`
8994

9095
### `ImagetilerOptions` properties
@@ -108,5 +113,4 @@ property | type | default | allowed | description
108113
`$overwrite_base_image` | bool | false | * |
109114
`$overwrite_tile_image` | bool | false | * |
110115
`$clean_up` | bool | true | * | whether or not to delete temp images
111-
`$optimize_output` | bool | false | * | enable image optimization
112-
`$optimizer_settings` | array | [] | * | image optimizer settings, see [ImageOptimizer configuration](https://github.com/psliwa/image-optimizer#configuration)
116+
`$optimize_output` | bool | false | * | enable image optimization (requires `Optimizer` instance)

0 commit comments

Comments
 (0)