Skip to content
This repository was archived by the owner on Jan 29, 2021. It is now read-only.

Commit

Permalink
Merge pull request #128 from SergeR/FitTransformer
Browse files Browse the repository at this point in the history
Added FitTransformer call
  • Loading branch information
milesj committed Jul 9, 2013
2 parents b6076a3 + 0e719a1 commit efc552c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Model/Behavior/AttachmentBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Transit\Transformer\Image\ScaleTransformer;
use Transit\Transformer\Image\ExifTransformer;
use Transit\Transformer\Image\RotateTransformer;
use Transit\Transformer\Image\FitTransformer;
use Transit\Transporter\Aws\S3Transporter;
use Transit\Transporter\Aws\GlacierTransporter;

Expand All @@ -35,6 +36,7 @@ class AttachmentBehavior extends ModelBehavior {
const SCALE = 'scale';
const ROTATE = 'rotate';
const EXIF = 'exif';
const FIT = 'fit';

/**
* Transportation types.
Expand Down Expand Up @@ -534,6 +536,7 @@ protected function _setTransporter(Model $model, Transit $transit, array $attach
* @uses Transit\Transformer\Image\ScaleTransformer
* @uses Transit\Transformer\Image\RotateTransformer
* @uses Transit\Transformer\Image\ExifTransformer
* @uses Transit\Transformer\Image\FitTransformer
*
* @param array $options
* @return \Transit\Transformer
Expand All @@ -559,6 +562,9 @@ protected function _getTransformer(array $options) {
case self::EXIF:
return new ExifTransformer($options);
break;
case self::FIT:
return new FitTransformer($options);
break;
default:
throw new InvalidArgumentException(sprintf('Invalid transformation method %s', $options['method']));
break;
Expand Down

0 comments on commit efc552c

Please sign in to comment.