diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index e261f05..1f8ceea 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -202,7 +202,7 @@ jobs: - name: Download appimage dependiences run: | - wget -c "https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/c008df652946408f357f502bab67bfcf6f303b4e/linuxdeploy-plugin-gtk.sh" + wget -c "https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh" wget -c "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" chmod +x linuxdeploy-plugin-gtk.sh chmod +x linuxdeploy-x86_64.AppImage diff --git a/czkawka_core/src/common_items.rs b/czkawka_core/src/common_items.rs index 2fcf9d6..104e7ff 100644 --- a/czkawka_core/src/common_items.rs +++ b/czkawka_core/src/common_items.rs @@ -33,7 +33,7 @@ impl ExcludedItems { } if expression == "DEFAULT" { if cfg!(target_family = "unix") { - checked_expressions.push("*/.git/*,*/node_modules/*,*/lost+found/*,*/Trash/*,*/.Trash-*/*,*/snap/*".to_string()); + checked_expressions.push("*/.git/*,*/node_modules/*,*/lost+found/*,*/Trash/*,*/.Trash-*/*,*/snap/*,/home/*/.cache/*".to_string()); } if cfg!(target_family = "windows") { checked_expressions.push("*/.git/*,*/node_modules/*,*/lost+found/*,*:/windows/*".to_string()); diff --git a/czkawka_gui/src/double_click_opening.rs b/czkawka_gui/src/double_click_opening.rs index 77d51e9..e4076ff 100644 --- a/czkawka_gui/src/double_click_opening.rs +++ b/czkawka_gui/src/double_click_opening.rs @@ -106,8 +106,15 @@ pub fn common_open_function(tree_view: >k::TreeView, column_name: i32, column_ } } - if open::that(&end_path).is_err() { - println!("Failed to open {}", end_path); + match open::that(&end_path) { + Ok(t) => { + if !t.success() { + println!("Failed to open {}, status {:?}", end_path, t.code()); + } + } + Err(_) => { + println!("Failed to open {}", end_path); + } } } } diff --git a/czkawka_gui/src/initialize_gui.rs b/czkawka_gui/src/initialize_gui.rs index cb750d9..95b8fba 100644 --- a/czkawka_gui/src/initialize_gui.rs +++ b/czkawka_gui/src/initialize_gui.rs @@ -258,18 +258,25 @@ pub fn initialize_gui(gui_data: &GuiData) { break 'dir; } }; + if img.width() == 0 || img.height() == 0 { + add_text_to_text_view(&text_view_errors, format!("Cannot create preview of image {}, with 0 width or height", file_name).as_str()); + break 'dir; + } let ratio = img.width() / img.height(); let requested_dimensions = (400, 400); - let new_size; + let mut new_size; match ratio.cmp(&(requested_dimensions.0 / requested_dimensions.1)) { Ordering::Greater => { new_size = (requested_dimensions.0, (img.height() * requested_dimensions.0) / img.width()); + new_size = (std::cmp::max(new_size.0, 1), std::cmp::max(new_size.1, 1)); } Ordering::Less => { new_size = ((img.width() * requested_dimensions.1) / img.height(), requested_dimensions.1); + new_size = (std::cmp::max(new_size.0, 1), std::cmp::max(new_size.1, 1)); } Ordering::Equal => { new_size = requested_dimensions; + new_size = (std::cmp::max(new_size.0, 1), std::cmp::max(new_size.1, 1)); } } let img = img.resize(new_size.0, new_size.1, FilterType::Triangle); diff --git a/czkawka_gui/src/saving_loading.rs b/czkawka_gui/src/saving_loading.rs index e9c6799..6bbaf46 100644 --- a/czkawka_gui/src/saving_loading.rs +++ b/czkawka_gui/src/saving_loading.rs @@ -426,7 +426,7 @@ pub fn reset_configuration(gui_data: &GuiData, manual_clearing: bool) { { let entry_excluded_items = gui_data.entry_excluded_items.clone(); if cfg!(target_family = "unix") { - entry_excluded_items.set_text("*/.git/*,*/node_modules/*,*/lost+found/*,*/Trash/*,*/.Trash-*/*,*/snap/*"); + entry_excluded_items.set_text("*/.git/*,*/node_modules/*,*/lost+found/*,*/Trash/*,*/.Trash-*/*,*/snap/*,/home/*/.cache/*"); } if cfg!(target_family = "windows") { entry_excluded_items.set_text("*/.git/*,*/node_modules/*,*/lost+found/*,*:/windows/*");