Skip to content

Commit

Permalink
Fix crash on loading animated webp alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipK committed Sep 8, 2022
1 parent ddf60a2 commit 941b647
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
edition = "2021"
name = "boilr"
version = "1.4.8"
version = "1.4.9"

[dependencies]
base64 = "^0.13.0"
Expand Down Expand Up @@ -35,7 +35,7 @@ version = "^0.3.23"
[dependencies.image]
features = ["png","webp","jpeg"]
git = "https://github.com/PhilipK/image"
rev = "cb66840dd42785c7283206cc9805240501695a61"
rev = "55a668409b28fedcd6cd3dea25ae1b3cc9d25ec5"

[dependencies.reqwest]
default_features = false
Expand Down
8 changes: 4 additions & 4 deletions flatpak/cargo-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
{
"type": "git",
"url": "https://github.com/philipk/image",
"commit": "cb66840dd42785c7283206cc9805240501695a61",
"dest": "flatpak-cargo/git/image-cb66840"
"commit": "55a668409b28fedcd6cd3dea25ae1b3cc9d25ec5",
"dest": "flatpak-cargo/git/image-55a6684"
},
{
"type": "archive",
Expand Down Expand Up @@ -1685,7 +1685,7 @@
{
"type": "shell",
"commands": [
"cp -r --reflink=auto \"flatpak-cargo/git/image-cb66840/.\" \"cargo/vendor/image\""
"cp -r --reflink=auto \"flatpak-cargo/git\\image-55a6684\\.\" \"cargo/vendor/image\""
]
},
{
Expand Down Expand Up @@ -4439,7 +4439,7 @@
},
{
"type": "inline",
"contents": "[source.vendored-sources]\ndirectory = \"cargo/vendor\"\n\n[source.crates-io]\nreplace-with = \"vendored-sources\"\n\n[source.\"https://github.com/philipk/image\"]\ngit = \"https://github.com/philipk/image\"\nreplace-with = \"vendored-sources\"\nrev = \"cb66840dd42785c7283206cc9805240501695a61\"\n",
"contents": "[source.vendored-sources]\ndirectory = \"cargo/vendor\"\n\n[source.crates-io]\nreplace-with = \"vendored-sources\"\n\n[source.\"https://github.com/philipk/image\"]\ngit = \"https://github.com/philipk/image\"\nreplace-with = \"vendored-sources\"\nrev = \"55a668409b28fedcd6cd3dea25ae1b3cc9d25ec5\"\n",
"dest": "cargo",
"dest-filename": "config"
}
Expand Down
7 changes: 7 additions & 0 deletions flatpak/io.github.philipk.boilr.appdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ https://hughsie.github.io/oars/index.html
-->
<content_rating type="oars-1.1" />
<releases>
<release version="1.4.9" date="2022-09-08">
<description>
<ul>
<li>Fixed a crash that would happen when loading specific animated webp images that use alpha blending</li>
</ul>
</description>
</release>
<release version="1.4.8" date="2022-09-06">
<description>
<ul>
Expand Down
Binary file added src/testdata/tunic.webp
Binary file not shown.
6 changes: 6 additions & 0 deletions src/ui/defines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,10 @@ mod tests {
let res = load_image_from_path(std::path::Path::new("src/testdata/hollow.webp"));
assert!(res.is_err());
}

#[test]
pub fn test_image_load_animated_webp2() {
let res = load_image_from_path(std::path::Path::new("src/testdata/tunic.webp"));
assert!(res.is_err());
}
}
3 changes: 0 additions & 3 deletions src/ui/ui_image_download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -577,9 +577,6 @@ impl MyEguiApp {
let thumbnail_key = image.thumbnail_path.to_string_lossy().to_string();
let thumbnail = self.image_selected_state.image_handles.remove(&thumbnail_key);
if let Some((key,thumbnail)) = thumbnail {
dbg!(&full_image_key);
dbg!(&key);

self.image_selected_state
.image_handles
.insert(full_image_key, thumbnail);
Expand Down

0 comments on commit 941b647

Please sign in to comment.