diff --git a/doc/changelog.dox b/doc/changelog.dox index a747b703f..5a1117840 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -871,6 +871,7 @@ See also: [mosra/magnum#529](https://github.com/mosra/magnum/pull/529)) - Recognizing KTX2 for (compressed) 1D/2D/3D and multi-level 1D/2D/3D images in @relativeref{Trade,AnyImageConverter} +- Recognizing WebP files in @relativeref{Trade,AnyImageConverter} - Recognizing glTF files in @relativeref{Trade,AnySceneConverter} - Recognizing 3MF files in @relativeref{Trade,AnySceneImporter} - Recognizing OpenVBD files in @relativeref{Trade,AnyImageImporter} and diff --git a/src/MagnumPlugins/AnyImageConverter/AnyImageConverter.cpp b/src/MagnumPlugins/AnyImageConverter/AnyImageConverter.cpp index 9a94a614d..56b765749 100644 --- a/src/MagnumPlugins/AnyImageConverter/AnyImageConverter.cpp +++ b/src/MagnumPlugins/AnyImageConverter/AnyImageConverter.cpp @@ -132,6 +132,8 @@ bool AnyImageConverter::doConvertToFile(const ImageView2D& image, const Containe normalizedExtension == ".icb"_s || normalizedExtension == ".vst"_s) plugin = "TgaImageConverter"_s; + else if(normalizedExtension == ".webp"_s) + plugin = "WebPImageConverter"_s; else { Error{} << "Trade::AnyImageConverter::convertToFile(): cannot determine the format of" << filename << "for a 2D image"; return false; diff --git a/src/MagnumPlugins/AnyImageConverter/AnyImageConverter.h b/src/MagnumPlugins/AnyImageConverter/AnyImageConverter.h index 04a9ee7d2..5be59b99d 100644 --- a/src/MagnumPlugins/AnyImageConverter/AnyImageConverter.h +++ b/src/MagnumPlugins/AnyImageConverter/AnyImageConverter.h @@ -78,6 +78,8 @@ tries to convert the file with it. Supported formats: uncompressed 2D images. - OpenVDB (`*.vdb`), converted with any plugin that provides `OpenVdbImageConverter`. Only uncompressed 3D images. +- WebP (`*.webp`), converted with @ref WebPImageConverter or any other plugin + that provides it. Only uncompressed 2D images. As the converter plugin is picked based on file extension, only saving to files is supported. diff --git a/src/MagnumPlugins/AnyImageConverter/Test/AnyImageConverterTest.cpp b/src/MagnumPlugins/AnyImageConverter/Test/AnyImageConverterTest.cpp index 03b2de880..8dd1e3bd3 100644 --- a/src/MagnumPlugins/AnyImageConverter/Test/AnyImageConverterTest.cpp +++ b/src/MagnumPlugins/AnyImageConverter/Test/AnyImageConverterTest.cpp @@ -161,7 +161,8 @@ constexpr struct { /* Have at least one test case with uppercase */ {"JPEG uppercase", "output.JPG", "JpegImageConverter"}, {"KTX2", "foo.ktx2", "KtxImageConverter"}, - {"PNG", "file.png", "PngImageConverter"} + {"PNG", "file.png", "PngImageConverter"}, + {"WebP", "file.webp", "WebPImageConverter"} }; constexpr struct {