Fix #5065: .webp images upload support

Add ability to upload .webp images.

Animated WebP images aren't supported. This is because they aren't
supported by FFmpeg yet[1], so generating thumbnails and samples for
them would be more complicated than for other formats.

[1]: https://trac.ffmpeg.org/ticket/4907
This commit is contained in:
evazion
2022-10-25 21:58:25 -05:00
parent df0e9bc4a7
commit acea0d5553
17 changed files with 91 additions and 11 deletions

View File

@@ -197,6 +197,13 @@ class UploadsControllerTest < ActionDispatch::IntegrationTest
end
end
context "for an unsupported WebP file" do
should "fail for an animated WebP" do
create_upload!("test/files/webp/nyancat.webp", user: @user)
assert_match("File type is not supported", Upload.last.error)
end
end
context "for an unsupported AVIF file" do
should "fail for a grid image" do
create_upload!("test/files/avif/Image grid example.avif", user: @user)
@@ -309,6 +316,9 @@ class UploadsControllerTest < ActionDispatch::IntegrationTest
should_upload_successfully("test/files/avif/hdr_cosmos01000_cicp9-16-9_yuv444_full_qp40.avif")
should_upload_successfully("test/files/avif/paris_icc_exif_xmp.avif")
should_upload_successfully("test/files/avif/tiger_3layer_1res.avif")
should_upload_successfully("test/files/webp/test.webp")
should_upload_successfully("test/files/webp/fjord.webp")
end
context "uploading multiple files from your computer" do