Add a "image-default-formats" feature

To enable the feature from the image crate.
And enable it by default.
Because users of older version of slint may have enabled feature from
the image 0.24 crate. But since we upgrade to image 0.25, this these
format would not be supported by Slint. So enable them by default to
keep compatibility
This commit is contained in:
Olivier Goffart 2024-04-15 11:29:32 +02:00
parent 1d2201a7ce
commit a159562ea7
2 changed files with 8 additions and 1 deletions

View file

@ -25,6 +25,7 @@ default = [
"backend-default",
"renderer-femtovg",
"renderer-software",
"image-default-formats",
"accessibility",
"compat-1-2",
]
@ -34,7 +35,8 @@ default = [
## Newer patch version may put current functionality behind a new feature
## that would be enabled by default only if this feature was added.
## [More info in this blog post](https://slint.dev/blog/rust-adding-default-cargo-feature.html)
"compat-1-2" = []
"compat-1-6" = []
"compat-1-2" = ["compat-1-6", "image-default-formats"]
"compat-1-0" = ["compat-1-2", "renderer-software"]
## Enable use of the Rust standard library.
@ -84,6 +86,10 @@ accessibility = ["i-slint-backend-selector/accessibility"]
## [HasDisplayHandle](raw_window_handle_06::HasDisplayHandle) implementation.
raw-window-handle-06 = ["dep:raw-window-handle-06", "i-slint-backend-selector/raw-window-handle-06"]
## Enable all formats from the `image` crate. To increase what is supported from [`Image::load_from_path`]
## or in `@image-url`.
image-default-formats = ["i-slint-core/image-default-formats"]
#! ### Backends
#! Slint needs a backend that will act as liaison between Slint and the OS.

View file

@ -38,6 +38,7 @@ software-renderer = ["bytemuck"]
software-renderer-rotation = []
image-decoders = ["dep:image", "dep:clru"]
image-default-formats = ["image?/default-formats"]
svg = ["dep:resvg", "shared-fontdb"]
box-shadow-cache = []