Skip to content

Commit

Permalink
Typos and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
axllent committed Jul 5, 2016
1 parent a1b3078 commit 1cefe9d
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 20 deletions.
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/tests export-ignore
/docs export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.scrutinizer.yml export-ignore
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Changelog

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

## [1.0.1]

- Fix typo in README.md
- Add CHANGELOG & docs

## [1.0.0]

- Adopt semantic versioning releases
- Release versions
38 changes: 18 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,40 @@
# Automatically scale down uploaded images for SilverStripe 3
An extension to automatically scale down all new uploaded images in SilverStripe 3. If the uploaded
image is larger than a preconfigured size, it will be scaled down. The extension also supports
auto-rotation of JPG images eg: portrait images taken with digital cameras or cellphones.

An extension to automatically scale down all new uploaded images in SilverStripe 3\. If the uploaded image is larger than a preconfigured size, it will be scaled down. The extension also supports auto-rotation of JPG images eg: portrait images taken with digital cameras or cellphones.

## Requirements
* SilverStripe 3+
* GD support in PHP

- SilverStripe 3+
- GD support in PHP

## Usage
Simply install the module. All images are (by default) scaled to a maximum size of 960px (width) X 800px (height),
and auto-rotation (based on EXIF data) for JPG images is by default **on**. Please note that EXIF rotation only works
if the uploaded image is larger than the specified values, and of course is present.

Simply install the module. All images are (by default) scaled to a maximum size of 960px (width) X 800px (height), and auto-rotation (based on EXIF data) for JPG images is by default **on**. Please note that EXIF rotation only works if the uploaded image is larger than the specified values, and of course is present.

## Configuration
Create or edit a *.yml file in your mysite/_config/ folder (eg: mysite/_config/config.yml) and
add & edit the following:

Create or edit a *.yml file in your mysite/_config/ folder (eg: mysite/_config/config.yml) and add & edit the following:

```
ScaledUploads:
max-width: 960
max-height: 800
auto-rotate: 0
```

If you require larger images for a particular DataObject (such as full-page slideshows), but wish to keep all
other uploads scaled to a pre-set default, you can simply add something like this to your DataObject:
If you require larger images for a particular DataObject (such as full-page slideshows), but wish to keep all other uploads scaled to a pre-set default, you can simply add something like this to your DataObject:

```
public function onBeforeWrite() {
Config::inst()->update('ScaledUploads', 'max-width', 1600);
Config::inst()->update('ScaledUploads', 'max-height', 1600);
parent::onBeforeWrite();
public function onBeforeWrite()
{
Config::inst()->update('ScaledUploads', 'max-width', 1600);
Config::inst()->update('ScaledUploads', 'max-height', 1600);
parent::onBeforeWrite();
}
```

If you need to bypass (skip) ScaledUploads for any particular reason, use:

```
Config::inst()->update('ScaledUploads', 'bypass', true);
```
or
```
ScaledUploads::$bypass = true;
```
Empty file added docs/_manifest_exclude
Empty file.
3 changes: 3 additions & 0 deletions docs/code-of-conduct.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Code of conduct

Any discussions about this module, issues or pull requests should be done through the Github project page.
7 changes: 7 additions & 0 deletions docs/install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Installation

```
composer require axllent/silverstripe-scaled-uploads
```

Please refer to the [README.md](../README.md) for installation & configuration options.

0 comments on commit 1cefe9d

Please sign in to comment.