Skip to content

Commit

Permalink
Add a "image-default-formats" feature
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ogoffart committed Apr 15, 2024
1 parent 1d2201a commit a159562
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion api/rs/slint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ default = [
"backend-default",
"renderer-femtovg",
"renderer-software",
"image-default-formats",
"accessibility",
"compat-1-2",
]
Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions internal/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down

0 comments on commit a159562

Please sign in to comment.