Skip to content

Commit

Permalink
Fix image orientation and namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
TiagoSilvaPereira committed Sep 30, 2017
1 parent 9a70b44 commit 00b4478
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "kingofcode/laravel-uploadable",
"description": "Laravel Uploadable trait to automatically upload images and files with minimum configuration",
"type": "library",
"version": "0.1.3",
"version": "0.1.4",
"license": "MIT",
"keywords": [
"upload",
Expand Down
4 changes: 2 additions & 2 deletions src/Uploadable.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace KingOfCode\Uploadable;
namespace KingOfCode\Upload;

use KingOfCode\Uploadable\Uploader;
use KingOfCode\Upload\Uploader;
use Illuminate\Database\Eloquent\Model;

trait Uploadable {
Expand Down
8 changes: 5 additions & 3 deletions src/Uploader.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace KingOfCode\Uploadable;
namespace KingOfCode\Upload;

use Image;
use Intervention\Image\Facades\Image;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\Storage;

Expand Down Expand Up @@ -152,7 +152,9 @@ private function getModelName()

private function getResizedImage($image, $size) {
if($size !== 'image_width') {
$image = Image::make($image)->resize($size, null, function ($constraint) {
$image = Image::make($image);
$image->orientate();
$image->resize($size, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
});
Expand Down

0 comments on commit 00b4478

Please sign in to comment.