Skip to content

Commit

Permalink
Bug(Thumbnails): Add Imagick switch to thumbnails
Browse files Browse the repository at this point in the history
  • Loading branch information
AW0005 committed Jan 14, 2024
1 parent 4ae9c15 commit 4f46171
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/Services/CharacterManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,13 @@ public function processImage($characterImage) {
* @param mixed $isMyo
*/
public function cropThumbnail($points, $characterImage, $isMyo = false) {
$imageProperties = getimagesize($characterImage->imagePath . '/' . $characterImage->imageFileName);
if ($imageProperties[0] > 2000 || $imageProperties[1] > 2000) {
// For large images (in terms of dimensions),
// use imagick instead, as it's better at handling them
Config::set('image.driver', 'imagick');
}

$image = Image::make($characterImage->imagePath.'/'.$characterImage->imageFileName);

if (config('lorekeeper.settings.masterlist_image_format') != 'png' && config('lorekeeper.settings.masterlist_image_format') != null && config('lorekeeper.settings.masterlist_image_background') != null) {
Expand Down

0 comments on commit 4f46171

Please sign in to comment.