diff --git a/app/Jobs/ProcessNewImage.php b/app/Jobs/ProcessNewImage.php index 7b141e1f9..bfdb7452b 100644 --- a/app/Jobs/ProcessNewImage.php +++ b/app/Jobs/ProcessNewImage.php @@ -81,8 +81,9 @@ public function __construct(Image $image) */ public function handle() { - $this->width = config('thumbnails.width'); - $this->height = config('thumbnails.height'); + // Double the size for crisp display on high-dpi montors. + $this->width = config('thumbnails.width') * 2; + $this->height = config('thumbnails.height') * 2; $this->threshold = config('image.tiles.threshold'); try { diff --git a/app/Jobs/ProcessNewVideo.php b/app/Jobs/ProcessNewVideo.php index 49951ae4c..41c297c6a 100644 --- a/app/Jobs/ProcessNewVideo.php +++ b/app/Jobs/ProcessNewVideo.php @@ -261,8 +261,9 @@ public function generateVideoThumbnails($disk, $fragment, $tmpDir) // Config for normal thumbs $format = config('thumbnails.format'); $thumbCount = config('videos.thumbnail_count'); - $width = config('thumbnails.width'); - $height = config('thumbnails.height'); + // Double the size for crisp display on high-dpi montors. + $width = config('thumbnails.width') * 2; + $height = config('thumbnails.height') * 2; // Config for sprite thumbs $thumbnailsPerSprite = config('videos.sprites_thumbnails_per_sprite'); diff --git a/config/thumbnails.php b/config/thumbnails.php index b7e089680..7a8657e55 100644 --- a/config/thumbnails.php +++ b/config/thumbnails.php @@ -12,8 +12,8 @@ | you are doing, since the views must work with these images. The images are always | scaled proportionally, so this values are kind of a max-width and max-height. */ - 'width' => 360, - 'height' => 270, + 'width' => 180, + 'height' => 135, /* | Thumbnail file format. Depending on your thumbnail service, different formats are diff --git a/tests/php/Jobs/ProcessNewImageTest.php b/tests/php/Jobs/ProcessNewImageTest.php index 5b820a0db..1dcc7d3a8 100644 --- a/tests/php/Jobs/ProcessNewImageTest.php +++ b/tests/php/Jobs/ProcessNewImageTest.php @@ -95,9 +95,9 @@ public function testHandleMakeThumbnail() $size = getimagesize(Storage::disk('test-thumbs')->path("{$prefix}.{$format}")); $config = [config('thumbnails.width'), config('thumbnails.height')]; - $this->assertTrue($size[0] <= $config[0]); - $this->assertTrue($size[1] <= $config[1]); - $this->assertTrue($size[0] == $config[0] || $size[1] == $config[1]); + $this->assertTrue($size[0] <= ($config[0] * 2)); + $this->assertTrue($size[1] <= ($config[1] * 2)); + $this->assertTrue($size[0] == ($config[0] * 2) || $size[1] == ($config[1] * 2)); } public function testHandleMakeThumbnailNotReadable()