1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-02 06:40:06 -04:00

Update image crate to 0.25 (#4160)

To not produce duplicating deps in Rerun
(https://github.com/rerun-io/rerun/pull/5280) I suggest we wait with
merging this until these crates have updated to `image` 0.25:
* [x] [`arboard`](https://crates.io/crates/arboard)
* [x] [`gltf`](https://crates.io/crates/gltf)
This commit is contained in:
Emil Ernerfeldt
2024-05-13 13:35:15 +02:00
committed by GitHub
parent acfe9f6f3b
commit 44d65f41ac
13 changed files with 33 additions and 60 deletions

View File

@@ -154,9 +154,7 @@ egui-winit = { workspace = true, default-features = false, features = [
"clipboard",
"links",
] }
image = { version = "0.24", default-features = false, features = [
"png",
] } # Needed for app icon
image = { workspace = true, features = ["png"] } # Needed for app icon
winit = { workspace = true, default-features = false, features = ["rwh_06"] }
# optional native:

View File

@@ -54,7 +54,7 @@ impl IconDataExt for IconData {
image
.write_to(
&mut std::io::Cursor::new(&mut png_bytes),
image::ImageOutputFormat::Png,
image::ImageFormat::Png,
)
.map_err(|err| err.to_string())?;
Ok(png_bytes)

View File

@@ -118,7 +118,7 @@ fn set_app_icon_windows(icon_data: &IconData) -> AppIconStatus {
if image_scaled
.write_to(
&mut std::io::Cursor::new(&mut image_scaled_bytes),
image::ImageOutputFormat::Png,
image::ImageFormat::Png,
)
.is_err()
{

View File

@@ -60,10 +60,7 @@ wgpu = { workspace = true, features = ["webgpu", "webgl"], optional = true }
# feature "http":
ehttp = { version = "0.5", optional = true }
image = { version = "0.24", optional = true, default-features = false, features = [
"jpeg",
"png",
] }
image = { workspace = true, optional = true, features = ["jpeg", "png"] }
poll-promise = { version = "0.3", optional = true, default-features = false }
# feature "persistence":

View File

@@ -45,8 +45,7 @@ http = ["dep:ehttp"]
##
## You also need to ALSO opt-in to the image formats you want to support, like so:
## ```toml
## image = { version = "0.24", features = ["jpeg", "png"] } # Add the types you want support for
## image = { version = "0.25", features = ["jpeg", "png"] } # Add the types you want support for
## ```
image = ["dep:image"]
@@ -82,7 +81,7 @@ chrono = { version = "0.4", optional = true, default-features = false, features
## Enable this when generating docs.
document-features = { workspace = true, optional = true }
image = { version = "0.24", optional = true, default-features = false }
image = { workspace = true, optional = true }
# file feature
mime_guess2 = { version = "2", optional = true, default-features = false }

View File

@@ -13,7 +13,7 @@ One thing `egui_extras` is commonly used for is to install image loaders for `eg
```toml
egui_extras = { version = "*", features = ["all_loaders"] }
image = { version = "0.24", features = ["jpeg", "png"] } # Add the types you want support for
image = { version = "0.25", features = ["jpeg", "png"] } # Add the types you want support for
```
```rs

View File

@@ -43,7 +43,7 @@ impl RetainedImage {
/// `image_bytes` should be the raw contents of an image file (`.png`, `.jpg`, …).
///
/// Requires the "image" feature. You must also opt-in to the image formats you need
/// with e.g. `image = { version = "0.24", features = ["jpeg", "png"] }`.
/// with e.g. `image = { version = "0.25", features = ["jpeg", "png"] }`.
///
/// # Errors
/// On invalid image or unsupported image format.
@@ -195,7 +195,7 @@ use egui::ColorImage;
/// Load a (non-svg) image.
///
/// Requires the "image" feature. You must also opt-in to the image formats you need
/// with e.g. `image = { version = "0.24", features = ["jpeg", "png"] }`.
/// with e.g. `image = { version = "0.25", features = ["jpeg", "png"] }`.
///
/// # Errors
/// On invalid image or unsupported image format.

View File

@@ -20,7 +20,7 @@
///
/// ```toml,ignore
/// egui_extras = { version = "*", features = ["all_loaders"] }
/// image = { version = "0.24", features = ["jpeg", "png"] } # Add the types you want support for
/// image = { version = "0.25", features = ["jpeg", "png"] } # Add the types you want support for
/// ```
///
/// ⚠ You have to configure both the supported loaders in `egui_extras` _and_ the supported image formats