Skip to content

Commit

Permalink
Update configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
axllent committed Jul 7, 2017
1 parent 49f5bf8 commit 2f1dd9f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

Notable changes to this project will be documented in this file.

## [2.0.2]
## [2.1.0]

- Write modified file back properly
- Write modified file properly
- Update configs

## [2.0.1]

Expand Down
12 changes: 6 additions & 6 deletions docs/en/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ To set your own configuration, simply create a `mysite/_config/scaled-uploads.ym

```yaml
Axllent\ScaledUploads\ScaledUploads:
max-width: 960 # Maximum width - default 960
max-height: 800 # Maximum height - default 800
auto-rotate: true # Automatically rotate images that rely on exif information for rotation - default true
max_width: 960 # Maximum width - default 960
max_height: 800 # Maximum height - default 800
auto_rotate: true # Automatically rotate images that rely on exif information for rotation - default true
bypass: false # Bypass (skip) this plugin when uploading - default false
force-resampling: true # Force re-saving the image even if it is smaller - default false
force_resampling: true # Force re-saving the image even if it is smaller - default false
```
If you require larger images for a particular DataObject (such as full-width banner), but wish to keep all other uploads scaled
Expand All @@ -22,8 +22,8 @@ class BannerImage extends Image
{
public function onBeforeWrite()
{
Config::inst()->update('Axllent\\ScaledUploads\\ScaledUploads', 'max-width', 1600);
Config::inst()->update('Axllent\\ScaledUploads\\ScaledUploads', 'max-height', 1600);
Config::inst()->update('Axllent\\ScaledUploads\\ScaledUploads', 'max_width', 1600);
Config::inst()->update('Axllent\\ScaledUploads\\ScaledUploads', 'max_height', 1600);
parent::onBeforeWrite();
}
}
Expand Down

0 comments on commit 2f1dd9f

Please sign in to comment.