You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For some reasons we may wish to set wallpapers with no filename extension (for example, I have a script to move wallpaper to ~/.local/share/background ) . However, swww refuses to use such files, throwing Error: "failed to open image '\"/home/aleksana/.local/share/background\"': The image format could not be determined".
In most cases on desktop linux, we do not determine file by its filename extension, but use mine types instead. You can use file --mime-type foo.bar to view a file's type.
The text was updated successfully, but these errors were encountered:
The related code is in src/main.rs#L142, and the docs suggests .with_guessed_format(). I didn't make a pull request because I don't have a knowledge of writing rust at all. Please test it if possible.
Okay so I ended up writing this patch on my own (This is for 0.6.0, as master is unusable when I test it)
--- a/src/daemon/processor/mod.rs+++ b/src/daemon/processor/mod.rs@@ -138,7 +138,8 @@ impl Processor {
pub fn process(&mut self, requests: Vec<ProcessorRequest>) -> Answer {
for request in requests {
- let img = match image::open(&request.path) {+ let mut reader = image::io::Reader::open(&request.path).expect("idk").with_guessed_format().expect("The image format could not be determined");+ let img = match reader.decode() {
Ok(i) => i.into_rgba8(),
Err(e) => {
return Answer::Err(format!(
For some reasons we may wish to set wallpapers with no filename extension (for example, I have a script to move wallpaper to
~/.local/share/background
) . However, swww refuses to use such files, throwingError: "failed to open image '\"/home/aleksana/.local/share/background\"': The image format could not be determined"
.In most cases on desktop linux, we do not determine file by its filename extension, but use mine types instead. You can use
file --mime-type foo.bar
to view a file's type.The text was updated successfully, but these errors were encountered: