Skip to content

Commit

Permalink
Improved image
Browse files Browse the repository at this point in the history
  • Loading branch information
libern committed Jan 10, 2020
1 parent a0c9f55 commit 4aaf1e6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Someline/Image/SomelineImageService.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,18 +401,18 @@ public function showImage($template_name, $image_name, array $image_templates =
}

$file = $storageDisk->get($file_path);
$full_file_path = $storageDisk->path($file_path);
$type = $storageDisk->mimeType($file_path);

// if gif or original
if (str_contains($image_name, 'gif') || ($imageTemplate->isOriginal() && $imageTemplate->isEmptyOptions())) {
$response = response($file, 200)
->header('Content-Type', $type);
} else {

// convert to image
$img = Image::cache(function ($image) use ($file, $imageTemplate) {
$img = Image::cache(function ($image) use ($full_file_path, $imageTemplate) {
/** @var \Intervention\Image\Image $image */
$image = $image->make($file)->orientate();
$image = $image->make($full_file_path)->orientate();

// resize
if (!$imageTemplate->isOriginal()) {
Expand Down

0 comments on commit 4aaf1e6

Please sign in to comment.