Skip to content

Commit

Permalink
Resolved dependencies for laravel 10.
Browse files Browse the repository at this point in the history
  • Loading branch information
RTippin committed Feb 26, 2023
1 parent ffc3a62 commit 83bb92d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
"require": {
"php": "^8.1|^8.2",
"ext-json": "*",
"laravel/framework": "^10.0",
"intervention/image": "^2.5",
"intervention/imagecache": "^2.5",
"joypixels/emoji-toolkit": "^6.0",
"intervention/image": "^2.5"
"laravel/framework": "^10.0"
},
"require-dev": {
"phpunit/phpunit": "^10.0",
Expand Down
16 changes: 5 additions & 11 deletions src/Services/ImageRenderService.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,6 @@ private function renderDefaultImage(?string $alias = null): BinaryFileResponse
}

/**
* @todo Add cache back in
*
* @param string $file
* @param string $size
* @return BinaryFileResponse|Response
Expand All @@ -303,15 +301,11 @@ private function renderImageSize(string $file, string $size)
? $width = null
: $height = null;

// $resize = $this->imageManager->cache(function ($image) use ($file, $width, $height) {
// return $image->make($file)->resize($width, $height, function ($constraint) {
// $constraint->aspectRatio();
// });
// }, 120);

$resize = $this->imageManager->make($file)->resize($width, $height, function ($constraint) {
$constraint->aspectRatio();
});
$resize = $this->imageManager->cache(function ($image) use ($file, $width, $height) {
return $image->make($file)->resize($width, $height, function ($constraint) {
$constraint->aspectRatio();
});
}, 120);

return $this->imageManager->make($resize)->response();
} catch (Exception $e) {
Expand Down

0 comments on commit 83bb92d

Please sign in to comment.