Skip to content
This repository has been archived by the owner on Jun 11, 2019. It is now read-only.

Commit

Permalink
Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Jose Luis Fonseca committed Dec 29, 2014
1 parent 482fa75 commit e9dc485
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions src/Joselfonseca/ImageManager/ImageRender.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,49 +31,47 @@ protected function resizeNormal() {
if (empty($this->path)) {
$this->image = \Image::cache(function($image) {
if (!empty($this->width) && empty($this->height)) {
$image->canvas(800, 800, $this->bgcolor)->resize($this->width, null, function ($constraint) {
return $image->canvas(800, 800, $this->bgcolor)->resize($this->width, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
});
} elseif (empty($this->width) && !empty($this->height)) {
$image->canvas(800, 800, $this->bgcolor)->resize(null, $this->height, function ($constraint) {
return $image->canvas(800, 800, $this->bgcolor)->resize(null, $this->height, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
});
} elseif (!empty($this->width) && !empty($this->height)) {
$image->canvas(800, 800, $this->bgcolor)->resize($this->width, $this->height);
} else{
return $image->canvas(800, 800, $this->bgcolor);
}
return $image;
}, null, true);
}, 10, true);
} else {
$this->image = \Image::cache(function($image) {
if (!empty($this->width) && empty($this->height)) {
$image->make($this->destination . '/' . $this->path)->resize($this->width, null, function ($constraint) {
return $image->make($this->destination . '/' . $this->path)->resize($this->width, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
});
} elseif (empty($this->width) && !empty($this->height)) {
$image->make($this->destination . '/' . $this->path)->resize(null, $this->height, function ($constraint) {
return $image->make($this->destination . '/' . $this->path)->resize(null, $this->height, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
});
} elseif (!empty($this->width) && !empty($this->height)) {
$image->make($this->destination . '/' . $this->path)->resize($this->width, $this->height);
} else{
return $image->make($this->destination . '/' . $this->path);
}
return $image;
}, null, true);
}, 10, true);
}
}

protected function resizeCanvas() {
if (empty($this->path)) {
$this->image = \Image::cache(function($image) {
return $image->canvas(800, 800, $this->bgcolor)->resizeCanvas($this->width, $this->height, $this->position, false, $this->bgcolor);
}, null, true);
}, 10, true);
} else {
$this->image = \Image::cache(function($image) {
return $image->make($this->destination . '/' . $this->path)->resizeCanvas($this->width, $this->height, $this->position, false, $this->bgcolor);
}, null, true);
}, 10, true);
}
}

Expand Down

0 comments on commit e9dc485

Please sign in to comment.