diff --git a/doc/changelog.dox b/doc/changelog.dox index 420007ee0..2e2f1a08d 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -459,6 +459,8 @@ See also: @ref Trade::AnimationTrackType out of it - New convenience @ref Trade::AnimationData constructors taking an @ref std::initializer_list of @ref Trade::AnimationTrackData +- Recognizing `*.ico` and `*.cur` files in + @ref Trade::AnyImageImporter "AnyImageImporter" @subsection changelog-latest-buildsystem Build system diff --git a/src/MagnumPlugins/AnyImageImporter/AnyImageImporter.cpp b/src/MagnumPlugins/AnyImageImporter/AnyImageImporter.cpp index 76a9da075..d4ab0636a 100644 --- a/src/MagnumPlugins/AnyImageImporter/AnyImageImporter.cpp +++ b/src/MagnumPlugins/AnyImageImporter/AnyImageImporter.cpp @@ -72,6 +72,9 @@ void AnyImageImporter::doOpenFile(const std::string& filename) { plugin = "GifImporter"; else if(Utility::String::endsWith(normalized, ".hdr")) plugin = "HdrImporter"; + else if(Utility::String::endsWith(normalized, ".ico") || + Utility::String::endsWith(normalized, ".cur")) + plugin = "IcoImporter"; else if(Utility::String::endsWith(normalized, ".jpg") || Utility::String::endsWith(normalized, ".jpeg") || Utility::String::endsWith(normalized, ".jpe")) diff --git a/src/MagnumPlugins/AnyImageImporter/AnyImageImporter.h b/src/MagnumPlugins/AnyImageImporter/AnyImageImporter.h index 110d172f3..8296e4719 100644 --- a/src/MagnumPlugins/AnyImageImporter/AnyImageImporter.h +++ b/src/MagnumPlugins/AnyImageImporter/AnyImageImporter.h @@ -67,6 +67,8 @@ tries to open the file with it. Supported formats: plugin that provides `OpenExrImporter` - Radiance HDR (`*.hdr` or data with corresponding signature), loaded with any plugin that provides `HdrImporter` +- Windows icon/cursor (`*.ico`, `*.cur`), loaded with @ref IcoImporter or any + other plugin that provides it - JPEG (`*.jpg`, `*.jpe`, `*.jpeg` or data with corresponding signature), loaded with @ref JpegImporter or any other plugin that provides it - JPEG 2000 (`*.jp2`), loaded with any plugin that provides diff --git a/src/MagnumPlugins/AnyImageImporter/Test/AnyImageImporterTest.cpp b/src/MagnumPlugins/AnyImageImporter/Test/AnyImageImporterTest.cpp index 87df72535..dd9f342be 100644 --- a/src/MagnumPlugins/AnyImageImporter/Test/AnyImageImporterTest.cpp +++ b/src/MagnumPlugins/AnyImageImporter/Test/AnyImageImporterTest.cpp @@ -85,6 +85,7 @@ constexpr struct { {"EXR data", "image.exr", fileCallback, "OpenExrImporter"}, {"HDR", "rgb.hdr", nullptr, "HdrImporter"}, {"HDR data", "rgb.hdr", fileCallback, "HdrImporter"}, + {"ICO", "pngs.ico", nullptr, "IcoImporter"}, {"DDS", "rgba_dxt1.dds", nullptr, "DdsImporter"}, {"DDS data", "rgba_dxt1.dds", fileCallback, "DdsImporter"}, {"BMP", "image.bmp", nullptr, "BmpImporter"}, diff --git a/src/MagnumPlugins/AnyImageImporter/Test/CMakeLists.txt b/src/MagnumPlugins/AnyImageImporter/Test/CMakeLists.txt index e11de6a81..f8d47fcc4 100644 --- a/src/MagnumPlugins/AnyImageImporter/Test/CMakeLists.txt +++ b/src/MagnumPlugins/AnyImageImporter/Test/CMakeLists.txt @@ -53,6 +53,7 @@ corrade_add_test(AnyImageImporterTest AnyImageImporterTest.cpp FILES gray.jpg image.exr + pngs.ico rgb.basis rgb.hdr rgb.png diff --git a/src/MagnumPlugins/AnyImageImporter/Test/pngs.ico b/src/MagnumPlugins/AnyImageImporter/Test/pngs.ico new file mode 100644 index 000000000..695e1a0a6 Binary files /dev/null and b/src/MagnumPlugins/AnyImageImporter/Test/pngs.ico differ