Make Cosmic Files show .exe icons (#2070)
* [Feature Request] Make Cosmic Files show .exe icons like Dolphin * Sped Up Icon Extraction * Compacted Code * Replace wrestool with pelite crate for .exe icon extraction * Run PE icon extraction as external thumbnailer * Use dedicated external EXE thumbnailer * Remove embedded EXE thumbnailer * Move cosmic-files-thumbnailer to new crate --------- Co-authored-by: ZlordHUN <137647604+ZlordHUN@users.noreply.github.com>
This commit is contained in:
parent
c0b8a8c60a
commit
b326e48cf6
8 changed files with 356 additions and 9 deletions
|
|
@ -172,3 +172,25 @@ pub fn thumbnailer(mime: &Mime) -> Vec<Thumbnailer> {
|
|||
let thumbnailer_cache = THUMBNAILER_CACHE.lock().unwrap();
|
||||
thumbnailer_cache.get(mime)
|
||||
}
|
||||
|
||||
#[cfg(all(test, feature = "desktop"))]
|
||||
mod tests {
|
||||
use super::Thumbnailer;
|
||||
use std::path::Path;
|
||||
|
||||
#[test]
|
||||
fn command_expands_thumbnailer_arguments() {
|
||||
let thumbnailer = Thumbnailer {
|
||||
exec: "cosmic-files-thumbnailer %o --size %s %i".to_string(),
|
||||
};
|
||||
|
||||
let command = thumbnailer
|
||||
.command(Path::new("input.exe"), Path::new("output.png"), 128)
|
||||
.expect("valid thumbnailer command");
|
||||
assert_eq!(command.get_program(), "cosmic-files-thumbnailer");
|
||||
assert_eq!(
|
||||
command.get_args().collect::<Vec<_>>(),
|
||||
["output.png", "--size", "128", "input.exe"]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue