From 19fbb59f393d8441037fb912162a841df654878d Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 14 Jan 2025 14:42:42 +0100 Subject: [PATCH] Update to Image 0.25 Added image-default-formats with all the format supported by image by default, and enable that feature by default. Also put that feature in compat-1-2 for compatibility with user that have used image 0.24 with enabled features. Make a new compat-1-10 feature that does not enable default format by default ChangeLog: upgraded image crate to 0.25, added a new cargo feature to enable all image formats. (that feature is enabled by default with compat-1-2, added compat-1-10 to disable it Fixes https://github.com/slint-ui/slint/issues/7251 --- Cargo.toml | 2 +- api/cpp/Cargo.toml | 6 ++---- api/rs/slint/Cargo.toml | 12 +++++++++--- api/rs/slint/lib.rs | 4 ++-- api/rs/slint/mcu.md | 12 ++++++------ api/wasm-interpreter/Cargo.toml | 2 +- demos/energy-monitor/Cargo.toml | 2 +- demos/printerdemo_mcu/Cargo.toml | 2 +- examples/bazel_build/MODULE.bazel | 2 +- examples/carousel/rust/Cargo.toml | 2 +- examples/mcu-board-support/Cargo.toml | 2 +- examples/uefi-demo/Cargo.toml | 2 +- internal/backends/testing/Cargo.toml | 2 +- internal/backends/winit/Cargo.toml | 2 +- internal/compiler/Cargo.toml | 3 +-- internal/compiler/passes/embed_glyphs.rs | 2 +- internal/core/Cargo.toml | 3 ++- internal/interpreter/Cargo.toml | 11 ++++++++--- internal/interpreter/lib.rs | 4 ++-- tests/driver/interpreter/Cargo.toml | 2 +- tests/driver/rust/Cargo.toml | 2 +- tests/screenshots/Cargo.toml | 2 +- tools/docsnapper/Cargo.toml | 2 +- tools/lsp/Cargo.toml | 9 +++------ tools/viewer/Cargo.toml | 5 +---- 25 files changed, 51 insertions(+), 48 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5a4bd3f37ca..67f08eb774e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -142,7 +142,7 @@ euclid = { version = "0.22.1", default-features = false } fontdb = { version = "0.22.0", default-features = false } fontdue = { version = "0.9.0" } glutin = { version = "0.32.0", default-features = false } -image = { version = "0.24", default-features = false, features = [ "png", "jpeg" ] } +image = { version = "0.25", default-features = false, features = [ "png", "jpeg" ] } itertools = { version = "0.14" } log = { version = "0.4.17" } resvg = { version= "0.44.0", default-features = false, features = ["text"] } diff --git a/api/cpp/Cargo.toml b/api/cpp/Cargo.toml index 5ccd5aa808d..1d1bd25da4a 100644 --- a/api/cpp/Cargo.toml +++ b/api/cpp/Cargo.toml @@ -44,7 +44,7 @@ gettext = ["i-slint-core/gettext-rs"] accessibility = ["i-slint-backend-selector/accessibility"] system-testing = ["i-slint-backend-selector/system-testing"] -std = ["image", "i-slint-core/default", "i-slint-backend-selector"] +std = ["i-slint-core/default", "i-slint-core/image-default-formats", "i-slint-backend-selector"] freestanding = ["i-slint-core/libm", "i-slint-core/unsafe-single-threaded"] experimental = [] @@ -55,10 +55,8 @@ i-slint-backend-selector = { workspace = true, optional = true } i-slint-backend-testing = { workspace = true, optional = true, features = ["ffi"] } i-slint-renderer-skia = { workspace = true, features = ["default", "x11", "wayland"], optional = true } i-slint-core = { workspace = true, features = ["ffi"] } -slint-interpreter = { workspace = true, features = ["ffi", "compat-1-2"], optional = true } +slint-interpreter = { workspace = true, features = ["ffi", "compat-1-10"], optional = true } raw-window-handle = { version = "0.6", optional = true } -# Enable image-rs' default features to make all image formats to C++ users -image = { workspace = true, optional = true, features = ["default"] } esp-backtrace = { version = "0.14.0", features = ["panic-handler", "println"], optional = true } esp-println = { version = "0.12.0", default-features = false, features = ["uart"], optional = true } diff --git a/api/rs/slint/Cargo.toml b/api/rs/slint/Cargo.toml index 38c163413dd..2d90223e5ff 100644 --- a/api/rs/slint/Cargo.toml +++ b/api/rs/slint/Cargo.toml @@ -25,16 +25,18 @@ default = [ "backend-default", "renderer-femtovg", "renderer-software", + "image-default-formats", "accessibility", - "compat-1-2", + "compat-1-10", ] ## Mandatory feature: -## This feature is required to keep the compatibility with Slint 1.2 +## This feature is required to keep the compatibility with Slint 1.10 ## 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-10" = [] +"compat-1-2" = ["compat-1-10", "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. diff --git a/api/rs/slint/lib.rs b/api/rs/slint/lib.rs index 2bae86aa9a0..fbfa306cd54 100644 --- a/api/rs/slint/lib.rs +++ b/api/rs/slint/lib.rs @@ -202,9 +202,9 @@ each instance will have their own instance of associated globals singletons. extern crate alloc; -#[cfg(not(feature = "compat-1-2"))] +#[cfg(not(feature = "compat-1-10"))] compile_error!( - "The feature `compat-1-2` must be enabled to ensure \ + "The feature `compat-1-10` must be enabled to ensure \ forward compatibility with future version of this crate" ); diff --git a/api/rs/slint/mcu.md b/api/rs/slint/mcu.md index 717112620ad..3bafff77a76 100644 --- a/api/rs/slint/mcu.md +++ b/api/rs/slint/mcu.md @@ -29,7 +29,7 @@ Start by adding a dependency to the `slint` and the `slint-build` crates to your Start with the `slint` crate like this: ```sh -cargo add slint@1.9.0 --no-default-features --features "compat-1-2 unsafe-single-threaded libm renderer-software" +cargo add slint@1.10.0 --no-default-features --features "compat-1-10 unsafe-single-threaded libm renderer-software" ``` The default features of the `slint` crate are tailored towards hosted environments and includes the "std" feature. In bare metal environments, @@ -37,7 +37,7 @@ you need to disable the default features. In the snippet above, three features are selected: - * `compat-1-2`: We select this feature when disabling the default features. For a detailed explanation see our blog post ["Adding default cargo features without breaking Semantic Versioning"](https://slint.dev/blog/rust-adding-default-cargo-feature.html). + * `compat-1-10`: We select this feature when disabling the default features. For a detailed explanation see our blog post ["Adding default cargo features without breaking Semantic Versioning"](https://slint.dev/blog/rust-adding-default-cargo-feature.html). * `unsafe-single-threaded`: Slint internally uses Rust's [`thread_local!`](https://doc.rust-lang.org/std/macro.thread_local.html) macro to store global data. This macro is only available in the Rust Standard Library (std), but not in bare metal environments. As a fallback, the `unsafe-single-threaded` feature changes Slint to use unsafe static for storage. This way, you guarantee to use Slint API only from a single thread, and not from interrupt handlers. @@ -52,7 +52,7 @@ This is the default when using the Rust 2021 Edition, but not if you use a works Then add the `slint-build` crate as a build dependency: ```sh -cargo add --build slint-build@1.9.0 +cargo add --build slint-build@1.10.0 ``` For reference: These are the relevant parts of your `Cargo.toml` file, @@ -68,11 +68,11 @@ edition = "2021" ## ... your other dependencies [dependencies.slint] -version = "1.8.0" +version = "1.10.0" default-features = false -features = ["compat-1-2", "unsafe-single-threaded", "libm", "renderer-software"] +features = ["compat-1-10", "unsafe-single-threaded", "libm", "renderer-software"] [build-dependencies] -slint-build = "1.9.0" +slint-build = "1.10.0" ``` ## Changes to `build.rs` diff --git a/api/wasm-interpreter/Cargo.toml b/api/wasm-interpreter/Cargo.toml index 5cf4d348977..eca8865fff7 100644 --- a/api/wasm-interpreter/Cargo.toml +++ b/api/wasm-interpreter/Cargo.toml @@ -17,7 +17,7 @@ publish = false crate-type = ["cdylib"] [dependencies] -slint-interpreter = { workspace = true, features = ["std", "backend-winit", "renderer-femtovg", "compat-1-2", "internal"] } +slint-interpreter = { workspace = true, features = ["std", "backend-winit", "renderer-femtovg", "compat-1-10", "internal"] } send_wrapper = { workspace = true } vtable = { workspace = true } diff --git a/demos/energy-monitor/Cargo.toml b/demos/energy-monitor/Cargo.toml index 94572125785..b98453fa444 100644 --- a/demos/energy-monitor/Cargo.toml +++ b/demos/energy-monitor/Cargo.toml @@ -14,7 +14,7 @@ license = "MIT" crate-type = ["cdylib", "lib"] [dependencies] -slint = { path = "../../api/rs/slint", default-features = false, features = ["compat-1-2"] } +slint = { path = "../../api/rs/slint", default-features = false, features = ["compat-1-10"] } mcu-board-support = { path = "../../examples/mcu-board-support", optional = true } chrono = { version = "0.4.34", optional = true, default-features = false, features = ["clock", "std", "wasmbind"] } weer_api = { version = "0.1", optional = true } diff --git a/demos/printerdemo_mcu/Cargo.toml b/demos/printerdemo_mcu/Cargo.toml index bfa6c2e7532..d0f8fc5d2de 100644 --- a/demos/printerdemo_mcu/Cargo.toml +++ b/demos/printerdemo_mcu/Cargo.toml @@ -19,7 +19,7 @@ simulator = ["slint/renderer-software", "slint/backend-winit", "slint/std"] default = ["simulator"] [dependencies] -slint = { path = "../../api/rs/slint", default-features = false, features = ["compat-1-2"] } +slint = { path = "../../api/rs/slint", default-features = false, features = ["compat-1-10"] } mcu-board-support = { path = "../../examples/mcu-board-support" } [build-dependencies] diff --git a/examples/bazel_build/MODULE.bazel b/examples/bazel_build/MODULE.bazel index 656e60a60b8..ca13111947a 100644 --- a/examples/bazel_build/MODULE.bazel +++ b/examples/bazel_build/MODULE.bazel @@ -39,7 +39,7 @@ crate = use_extension( "crate", ) -crate.spec(package = "slint", git = "https://github.com/slint-ui/slint", branch = "master", default_features = False, features = ["std","backend-winit", "renderer-skia-opengl", "compat-1-2"]) +crate.spec(package = "slint", git = "https://github.com/slint-ui/slint", branch = "master", default_features = False, features = ["std","backend-winit", "renderer-skia-opengl", "compat-1-10"]) crate.spec(package = "slint-build", git = "https://github.com/slint-ui/slint", branch = "master") crate.annotation( diff --git a/examples/carousel/rust/Cargo.toml b/examples/carousel/rust/Cargo.toml index 0c303ed4686..ccbf67d94cd 100644 --- a/examples/carousel/rust/Cargo.toml +++ b/examples/carousel/rust/Cargo.toml @@ -15,7 +15,7 @@ path = "main.rs" name = "carousel" [dependencies] -slint = { path = "../../../api/rs/slint", default-features = false, features = ["compat-1-2"] } +slint = { path = "../../../api/rs/slint", default-features = false, features = ["compat-1-10"] } mcu-board-support = { path = "../../mcu-board-support", optional = true } [build-dependencies] diff --git a/examples/mcu-board-support/Cargo.toml b/examples/mcu-board-support/Cargo.toml index b9bd29db75a..18b994ca61d 100644 --- a/examples/mcu-board-support/Cargo.toml +++ b/examples/mcu-board-support/Cargo.toml @@ -25,7 +25,7 @@ esp32-s2-kaluga-1 = ["slint/unsafe-single-threaded", "esp-hal/esp32s2", "embedde esp32-s3-box = ["slint/unsafe-single-threaded", "esp-hal/esp32s3", "embedded-hal", "embedded-hal-bus", "esp-alloc", "esp-println/esp32s3", "esp-backtrace/esp32s3", "dep:mipidsi", "embedded-graphics-core", "slint/libm", "tt21100"] [dependencies] -slint = { version = "=1.10.0", path = "../../api/rs/slint", default-features = false, features = ["compat-1-2", "renderer-software"] } +slint = { version = "=1.10.0", path = "../../api/rs/slint", default-features = false, features = ["compat-1-10", "renderer-software"] } i-slint-core-macros = { version = "=1.10.0", path = "../../internal/core-macros" } derive_more = { workspace = true } diff --git a/examples/uefi-demo/Cargo.toml b/examples/uefi-demo/Cargo.toml index 6b5085d52d5..625f2ee647c 100644 --- a/examples/uefi-demo/Cargo.toml +++ b/examples/uefi-demo/Cargo.toml @@ -18,7 +18,7 @@ uefi = { version = "0.33", features = ["panic_handler", "global_allocator"] } minipng = "=0.1.1" slint = { path = "../../api/rs/slint", default-features = false, features = [ - "compat-1-2", + "compat-1-10", "renderer-software", "libm", "log", diff --git a/internal/backends/testing/Cargo.toml b/internal/backends/testing/Cargo.toml index 4ffff184038..d85f510bf46 100644 --- a/internal/backends/testing/Cargo.toml +++ b/internal/backends/testing/Cargo.toml @@ -37,6 +37,6 @@ image = { workspace = true, optional = true, features = ["png"] } pb-rs = { version = "0.10.0", optional = true, default-features = false } [dev-dependencies] -slint = { path = "../../../api/rs/slint", default-features = false, features = ["std", "compat-1-2"] } +slint = { path = "../../../api/rs/slint", default-features = false, features = ["std", "compat-1-10"] } i-slint-core-macros = { path = "../../core-macros" } i-slint-common = { path = "../../common" } diff --git a/internal/backends/winit/Cargo.toml b/internal/backends/winit/Cargo.toml index 1a32d591dab..47c25d19ad5 100644 --- a/internal/backends/winit/Cargo.toml +++ b/internal/backends/winit/Cargo.toml @@ -83,7 +83,7 @@ objc2-app-kit = { version = "0.2.2" } cfg_aliases = { workspace = true } [dev-dependencies] -slint = { path = "../../../api/rs/slint", default-features = false, features = ["std", "compat-1-2", "backend-winit", "renderer-software", "raw-window-handle-06"] } +slint = { path = "../../../api/rs/slint", default-features = false, features = ["std", "compat-1-10", "backend-winit", "renderer-software", "raw-window-handle-06"] } [package.metadata.docs.rs] features = ["wayland", "renderer-software", "raw-window-handle-06"] diff --git a/internal/compiler/Cargo.toml b/internal/compiler/Cargo.toml index 19af2d4209f..bc8708af375 100644 --- a/internal/compiler/Cargo.toml +++ b/internal/compiler/Cargo.toml @@ -29,7 +29,7 @@ display-diagnostics = ["codemap", "codemap-diagnostic"] # Enabled the support to render images and font in the binary software-renderer = ["image", "dep:resvg", "fontdue", "i-slint-common/shared-fontdb", "dep:rayon"] -embed-glyphs-as-sdf = ["dep:fdsm", "dep:ttf-parser-fdsm", "dep:nalgebra", "dep:image-fdsm", "dep:rayon"] +embed-glyphs-as-sdf = ["dep:fdsm", "dep:ttf-parser-fdsm", "dep:nalgebra", "dep:rayon"] # Translation bundler bundle-translations = ["dep:polib"] @@ -62,7 +62,6 @@ resvg = { workspace = true, optional = true } fontdue = { workspace = true, optional = true, features = ["parallel"] } fdsm = { version = "0.6.0", optional = true, features = ["ttf-parser"]} ttf-parser-fdsm = { package = "ttf-parser", version = "0.24.1", optional = true } -image-fdsm = { package = "image", version = "0.25", optional = true, default-features = false } nalgebra = { version = "0.33.0", optional = true } rayon = { workspace = true, optional = true } # translations diff --git a/internal/compiler/passes/embed_glyphs.rs b/internal/compiler/passes/embed_glyphs.rs index 33da3971991..ed58be47bd2 100644 --- a/internal/compiler/passes/embed_glyphs.rs +++ b/internal/compiler/passes/embed_glyphs.rs @@ -521,7 +521,7 @@ fn generate_sdf_for_glyph( // Set up the resulting image and generate the distance field: - let mut sdf = image_fdsm::GrayImage::new(width, height); + let mut sdf = image::GrayImage::new(width, height); fdsm::generate::generate_sdf(&prepared_shape, range, &mut sdf); fdsm::render::correct_sign_sdf( &mut sdf, diff --git a/internal/core/Cargo.toml b/internal/core/Cargo.toml index a8cca3c9811..73248e37421 100644 --- a/internal/core/Cargo.toml +++ b/internal/core/Cargo.toml @@ -36,6 +36,7 @@ software-renderer-systemfonts = ["shared-fontdb", "rustybuzz", "fontdue", "softw software-renderer = ["bytemuck"] image-decoders = ["dep:image", "dep:clru"] +image-default-formats = ["image?/default-formats"] svg = ["dep:resvg", "shared-fontdb"] box-shadow-cache = [] @@ -107,7 +108,7 @@ web-sys = { workspace = true, features = [ "HtmlImageElement" ] } fontdb = { workspace = true, optional = true, default-features = true } [dev-dependencies] -slint = { path = "../../api/rs/slint", default-features = false, features = ["std", "compat-1-2"] } +slint = { path = "../../api/rs/slint", default-features = false, features = ["std", "compat-1-10"] } i-slint-backend-testing = { path="../backends/testing" } rustybuzz = { workspace = true } ttf-parser = { workspace = true } diff --git a/internal/interpreter/Cargo.toml b/internal/interpreter/Cargo.toml index f66c6c6eac0..79747112e32 100644 --- a/internal/interpreter/Cargo.toml +++ b/internal/interpreter/Cargo.toml @@ -20,18 +20,23 @@ path = "lib.rs" [features] -default = ["backend-default", "renderer-femtovg", "renderer-software", "accessibility", "compat-1-2"] +default = ["backend-default", "renderer-femtovg", "renderer-software", "accessibility", "image-default-formats", "compat-1-10"] ## Mandatory feature: -## This feature is required to keep the compatibility with Slint 1.2 +## This feature is required to keep the compatibility with Slint 1.10 ## Newer patch version may put current functionality behind a new feature ## that would be enabled by default only if this feature was added -"compat-1-2" = [] +"compat-1-10" = [] +"compat-1-2" = ["compat-1-10", "image-default-formats"] "compat-1-0" = ["compat-1-2"] ## enable the [`print_diagnostics`] function to show diagnostic in the console output display-diagnostics = ["i-slint-compiler/display-diagnostics"] +## 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"] + # (internal) export C++ FFI functions ffi = ["spin_on", "i-slint-core/ffi"] diff --git a/internal/interpreter/lib.rs b/internal/interpreter/lib.rs index 3e8c4b60878..17d70257719 100644 --- a/internal/interpreter/lib.rs +++ b/internal/interpreter/lib.rs @@ -72,9 +72,9 @@ instance.run().unwrap(); #![warn(missing_docs)] #![doc(html_logo_url = "https://slint.dev/logo/slint-logo-square-light.svg")] -#[cfg(not(feature = "compat-1-2"))] +#[cfg(not(feature = "compat-1-10"))] compile_error!( - "The feature `compat-1-2` must be enabled to ensure \ + "The feature `compat-1-10` must be enabled to ensure \ forward compatibility with future version of this crate" ); diff --git a/tests/driver/interpreter/Cargo.toml b/tests/driver/interpreter/Cargo.toml index 24d9aa8e13c..78da1a25ee6 100644 --- a/tests/driver/interpreter/Cargo.toml +++ b/tests/driver/interpreter/Cargo.toml @@ -18,7 +18,7 @@ path = "main.rs" name = "test-driver-interpreter" [dev-dependencies] -slint-interpreter = { workspace = true, features = ["display-diagnostics", "compat-1-2"] } +slint-interpreter = { workspace = true, features = ["display-diagnostics", "compat-1-10"] } i-slint-backend-testing = { workspace = true } itertools = { workspace = true } diff --git a/tests/driver/rust/Cargo.toml b/tests/driver/rust/Cargo.toml index 01d4f13d6df..536302e2049 100644 --- a/tests/driver/rust/Cargo.toml +++ b/tests/driver/rust/Cargo.toml @@ -23,7 +23,7 @@ build-time = ["i-slint-compiler", "spin_on"] [dependencies] slint = { workspace = true, features = ["std", "compat-1-2"] } i-slint-backend-testing = { workspace = true, features = ["internal"] } -slint-interpreter = { workspace = true, features = ["std", "compat-1-2", "internal"] } +slint-interpreter = { workspace = true, features = ["std", "compat-1-10", "internal"] } spin_on = { workspace = true } [build-dependencies] diff --git a/tests/screenshots/Cargo.toml b/tests/screenshots/Cargo.toml index 16f3d9f3ff4..de548387c4d 100644 --- a/tests/screenshots/Cargo.toml +++ b/tests/screenshots/Cargo.toml @@ -18,7 +18,7 @@ path = "main.rs" name = "test-driver-screenshot" [dependencies] -slint = { workspace = true, features = ["std", "compat-1-2"] } +slint = { workspace = true, features = ["std", "compat-1-10"] } i-slint-core = { workspace = true, features = ["default", "software-renderer"] } i-slint-backend-testing = { workspace = true } image = { workspace = true } diff --git a/tools/docsnapper/Cargo.toml b/tools/docsnapper/Cargo.toml index f48e924c2c6..af03caa7198 100644 --- a/tools/docsnapper/Cargo.toml +++ b/tools/docsnapper/Cargo.toml @@ -17,7 +17,7 @@ keywords = ["viewer", "gui", "ui", "toolkit"] [dependencies] i-slint-compiler = { workspace = true } i-slint-core = { workspace = true } -slint-interpreter = { workspace = true, features = ["display-diagnostics", "compat-1-2", "internal", "accessibility"] } +slint-interpreter = { workspace = true, features = ["display-diagnostics", "compat-1-10", "internal", "accessibility"] } i-slint-renderer-skia = { workspace = true, features = ["default", "wayland"] } clap = { workspace = true } diff --git a/tools/lsp/Cargo.toml b/tools/lsp/Cargo.toml index 42e9dedb5a1..5f05a0fda0e 100644 --- a/tools/lsp/Cargo.toml +++ b/tools/lsp/Cargo.toml @@ -68,7 +68,7 @@ preview-lense = [] ## to provide an implementation of the external preview API when building for WASM) preview-api = ["preview-external"] ## Build in the actual code to act as a preview for slint files. -preview-engine = ["dep:slint", "dep:slint-interpreter", "dep:i-slint-core", "dep:i-slint-backend-selector", "dep:image", "dep:slint-build", "dep:i-slint-backend-winit", "dep:muda", "dep:objc2-foundation"] +preview-engine = ["dep:slint", "dep:slint-interpreter", "dep:i-slint-core", "dep:i-slint-backend-selector", "dep:slint-build", "dep:i-slint-backend-winit", "dep:muda", "dep:objc2-foundation"] ## Build in the actual code to act as a preview for slint files. Does nothing in WASM! preview-builtin = ["preview-engine"] ## Support the external preview optionally used by e.g. the VSCode plugin @@ -92,17 +92,14 @@ smol_str = { workspace = true } # for the preview-engine feature i-slint-backend-selector = { workspace = true, optional = true } i-slint-core = { workspace = true, features = ["std"], optional = true } -slint = { workspace = true, features = ["compat-1-2"], optional = true } -slint-interpreter = { workspace = true, features = ["compat-1-2", "highlight", "internal"], optional = true } +slint = { workspace = true, features = ["compat-1-10"], optional = true } +slint-interpreter = { workspace = true, features = ["compat-1-10", "highlight", "internal", "image-default-formats"], optional = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] clap = { workspace = true } crossbeam-channel = "0.5" # must match the version used by lsp-server lsp-server = "0.7" -# Enable image-rs' default features to make all image formats available for the preview -image = { workspace = true, optional = true, features = ["default"] } - [target.'cfg(target_arch = "wasm32")'.dependencies] console_error_panic_hook = "0.1.5" js-sys = { version = "0.3.57" } diff --git a/tools/viewer/Cargo.toml b/tools/viewer/Cargo.toml index eaf9bbeabb2..612b83d717b 100644 --- a/tools/viewer/Cargo.toml +++ b/tools/viewer/Cargo.toml @@ -53,7 +53,7 @@ default = ["backend-default", "renderer-femtovg", "renderer-software"] [dependencies] i-slint-compiler = { workspace = true } i-slint-core = { workspace = true } -slint-interpreter = { workspace = true, features = ["display-diagnostics", "compat-1-2", "internal", "accessibility"] } +slint-interpreter = { workspace = true, features = ["display-diagnostics", "compat-1-10", "internal", "accessibility", "image-default-formats"] } i-slint-backend-selector = { workspace = true } clap = { workspace = true } @@ -67,9 +67,6 @@ env_logger = "0.11.0" itertools = { workspace = true } smol_str = { workspace = true } -# Enable image-rs' default features to make all image formats available for preview -image = { workspace = true, features = ["default"] } - [[bin]] name = "slint-viewer" path = "main.rs"