Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
reliq committed Nov 16, 2016
1 parent 6d13173 commit 8f03ca3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ReliQArts/GuidedImage/Traits/ImageGuider.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ public function resized(Request $request, GuidedContract $guidedImage, $width, $
$object = (in_array($object, $this->nulls)) ? false : true;

$skimFile = "$this->skimResized/$width-$height-_-_".$guidedImage->getName();
$image = false;

// Get intervention image
try {
Expand All @@ -184,9 +185,12 @@ public function resized(Request $request, GuidedContract $guidedImage, $width, $
$image = Image::make($skimFile);
}
} catch (NotReadableException $e) {
abort(404);
$image = false;
}

// if no image; abort
if (!$image) abort(404);

// Setup response with appropriate headers
$response = ($object) ? $image : new Response(File::get($skimFile), 200, $this->getImageHeaders($request, $image));

Expand Down

0 comments on commit 8f03ca3

Please sign in to comment.