From: Dan Brown Date: Fri, 23 May 2025 16:19:34 +0000 (+0100) Subject: Images: Added testing to cover animated avif handling X-Git-Tag: v25.05~1^2~8^2 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/131ac29df456263fa471fed5875228e0402db9d9 Images: Added testing to cover animated avif handling --- diff --git a/tests/Uploads/ImageTest.php b/tests/Uploads/ImageTest.php index 2c36f5f35..a2f03df34 100644 --- a/tests/Uploads/ImageTest.php +++ b/tests/Uploads/ImageTest.php @@ -68,7 +68,20 @@ class ImageTest extends TestCase $this->files->deleteAtRelativePath($imgDetails['path']); $this->assertStringContainsString('thumbs-', $imgDetails['response']->thumbs->gallery); - $this->assertStringNotContainsString('thumbs-', $imgDetails['response']->thumbs->display); + $this->assertStringNotContainsString('scaled-', $imgDetails['response']->thumbs->display); + } + + public function test_image_display_thumbnail_generation_for_animated_avif_images_uses_original_file() + { + $page = $this->entities->page(); + $admin = $this->users->admin(); + $this->actingAs($admin); + + $imgDetails = $this->files->uploadGalleryImageToPage($this, $page, 'animated.avif'); + $this->files->deleteAtRelativePath($imgDetails['path']); + + $this->assertStringContainsString('thumbs-', $imgDetails['response']->thumbs->gallery); + $this->assertStringNotContainsString('scaled-', $imgDetails['response']->thumbs->display); } public function test_image_edit() diff --git a/tests/test-data/animated.avif b/tests/test-data/animated.avif new file mode 100644 index 000000000..92f71459b Binary files /dev/null and b/tests/test-data/animated.avif differ