feat: handle dwebp re-coding errors
This commit is contained in:
parent
d37e0fb7a9
commit
d125b27015
2 changed files with 12 additions and 1 deletions
|
@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Handle dwebp re-coding errors
|
||||||
|
|
||||||
## [3.10.0] - 17.06.2024
|
## [3.10.0] - 17.06.2024
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -99,7 +99,14 @@ pub fn download_background() -> anyhow::Result<()> {
|
||||||
.arg("-o")
|
.arg("-o")
|
||||||
.arg(crate::BACKGROUND_PRIMARY_FILE.as_path())
|
.arg(crate::BACKGROUND_PRIMARY_FILE.as_path())
|
||||||
.spawn()?
|
.spawn()?
|
||||||
.wait_with_output()?;
|
.wait()?;
|
||||||
|
|
||||||
|
// If it failed to re-code the file - just copy it
|
||||||
|
// Will happen with HSR because devs apparently named
|
||||||
|
// their background image ".webp" while it's JPEG
|
||||||
|
if crate::BACKGROUND_PRIMARY_FILE.exists() {
|
||||||
|
std::fs::copy(crate::BACKGROUND_FILE.as_path(), crate::BACKGROUND_PRIMARY_FILE.as_path())?;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in a new issue