Skip to content

Commit

Permalink
Adding support for watermarks
Browse files Browse the repository at this point in the history
  • Loading branch information
antennaio committed Mar 15, 2016
1 parent c3c176d commit c21432f
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,22 @@ Additionally, you can setup presets and use them as a quicker way to apply manip
<img src="{{ ClydeImage::url('56a1472beca5d.jpg', 'thumbnail') }}">
```

## Watermarks

Watermarks are stored on the local filesystem by default. To use watermarks put the watermark files
in `storage/app/watermarks` directory. To adjust the location where watermark files are stored you can
edit `watermarks` and `watermarks_path_prefix` entries in the config.

```
ClydeImage::url('56a1472beca5d.jpg', [
'mark' => 'watermark.png',
'markpos' => 'top-right',
'markw' => '50',
'markh' => '50',
'markpad' => '10'
]);
```

## Security

All URLs generated by Clyde are signed by default. This means that there is always a signature
Expand Down
20 changes: 20 additions & 0 deletions config/clyde.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@
*/
'cache' => 'local',

/*
|--------------------------------------------------------------------------
| Watermarks Filesystem
|--------------------------------------------------------------------------
|
| Please specify watermarks filesystem (local or s3).
|
*/
'watermarks' => 'local',

/*
|--------------------------------------------------------------------------
| Source Path Prefix
Expand All @@ -42,6 +52,16 @@
*/
'cache_path_prefix' => '/uploads/.cache',

/*
|--------------------------------------------------------------------------
| Watermarks Path Prefix
|--------------------------------------------------------------------------
|
| This is a path where watermarks will be stored.
|
*/
'watermarks_path_prefix' => '/watermarks',

/*
|--------------------------------------------------------------------------
| Max Image Size
Expand Down
2 changes: 2 additions & 0 deletions src/Http/Controllers/ClydeImageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ public function show(Request $request, $filename)
$server = ServerFactory::create([
'source' => $this->files->disk(config('clyde.source'))->getDriver(),
'cache' => $this->files->disk(config('clyde.cache'))->getDriver(),
'watermarks' => $this->files->disk(config('clyde.watermarks'))->getDriver(),
'source_path_prefix' => config('clyde.source_path_prefix'),
'cache_path_prefix' => config('clyde.cache_path_prefix'),
'watermarks_path_prefix' => config('clyde.watermarks_path_prefix'),
'max_image_size' => config('clyde.max_image_size'),
'presets' => config('clyde.presets'),
'response' => new SymfonyResponseFactory()
Expand Down

0 comments on commit c21432f

Please sign in to comment.