-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add image filter to cache #372
Conversation
We don't need this. Instead, increase the cargo version from masterV2 to masterV3. The cache will won't consider files with older versions. |
Now get_previous_image_path returns error to the old version of cache and users will be forced to set the wallpaper again to update cache. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice. Just two small things and we can merge this.
common/src/cache.rs
Outdated
let mut filepath = cache_dir()?; | ||
clean_previous_verions(&filepath); | ||
|
||
filepath.push(output_name); | ||
if !filepath.is_file() { | ||
return Ok("".to_string()); | ||
return Ok(("Lanczos3".to_string(), "".to_string())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really get what this gives us. Is it just to improve the error messages?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, and it makes it easy to force swww-daemon ignore missing cache files.
How swww restore don't stop half done if one of the outputs don't have cache file and print name of the output for all errors |
Thanks! |
I primary use pixel art wallpapers, so the default filter for all restored images was annoying.
I modified cache so it stores filter and path to image separated by '\n' (I couldn't think of anything better). It can work with old version of cache if it doesn't contain '\n' using default filter.
I also fixed a crash that occurred when using a solid color on my system (EndevourOS + Hyprland): the drawable surface required RGBA image but was only provided with RGB.
I'm still learning Rust and English is not my native language, so sorry if anything is wrong.