Skip to content

Commit

Permalink
Merge pull request #29 from raykwok/master
Browse files Browse the repository at this point in the history
Fix the package name & Intervention Image 2.0.x compatibility. Thanks @raykwok
  • Loading branch information
andrewelkins committed Feb 11, 2015
2 parents b16de6d + 63386a6 commit d64de00
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Andrew13/Cabinet/CabinetServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class CabinetServiceProvider extends ServiceProvider {
*/
public function boot()
{
$this->package('andrew13/cabinet');
$this->package('andrewelkins/cabinet');
}

/**
Expand Down
12 changes: 9 additions & 3 deletions src/Andrew13/Cabinet/CabinetUpload.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Log;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Intervention\Image\Image;
use Intervention\Image\ImageManagerStatic as Image;

class CabinetUpload extends Eloquent
{
Expand Down Expand Up @@ -302,8 +302,14 @@ public function generateThumbnails($folder, $file)
$clonedImage->resize(
$image_params[0],
$image_params[1],
$image_params[2],
$image_params[3]
function($constraint) use ($image_params){
if($image_params[2]){
$constraint->aspectRatio();
}
if($image_params[3]){
$constraint->upsize();
}
}
)->save($folder . $tempFile->fileSystemName);

$thumbnails[] = $tempFile;
Expand Down

0 comments on commit d64de00

Please sign in to comment.