diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 7f8ca7a..e188529 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -14,7 +14,7 @@ jobs: matrix: toolchain: [ stable ] type: [ release ] - runs-on: macos-10.15 + runs-on: macos-latest steps: - uses: actions/checkout@v2 @@ -50,7 +50,7 @@ jobs: matrix: toolchain: [ stable ] type: [ release ] - runs-on: macos-10.15 + runs-on: macos-latest steps: - uses: actions/checkout@v2 diff --git a/Cargo.lock b/Cargo.lock index 7e70a84..a65a933 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2187,9 +2187,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534cfe58d6a18cc17120fbf4635d53d14691c1fe4d951064df9bd326178d7d5a" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ "bitflags", ] diff --git a/Changelog.md b/Changelog.md index 55748c2..b9e0adb 100644 --- a/Changelog.md +++ b/Changelog.md @@ -13,10 +13,12 @@ - Fix disabled ui when using invalid settings in similar music - [#740](https://github.com/qarmin/czkawka/pull/740) - Speedup searching for invalid extensions - [#740](https://github.com/qarmin/czkawka/pull/740) - Support for finding the smallest files - [#741](https://github.com/qarmin/czkawka/pull/741) -- Improve Windows CI - [#749](https://github.com/qarmin/czkawka/pull/749) +- Improved Windows CI - [#749](https://github.com/qarmin/czkawka/pull/749) - Ability to check for broken files by types - [#749](https://github.com/qarmin/czkawka/pull/749) - Add heif and Webp files support - [#750](https://github.com/qarmin/czkawka/pull/750) - Use in CLI Clap library instead StructOpt - [#759](https://github.com/qarmin/czkawka/pull/759) +- Multiple directories can be added via Manual Add button - [#782](https://github.com/qarmin/czkawka/pull/782) +- Option to exclude files from other filesystems in GUI(Linux) - [#776](https://github.com/qarmin/czkawka/pull/776) ## Version 4.1.0 - 24.04.2022r - New mode - finding files whose content not match with their extension - [#678](https://github.com/qarmin/czkawka/pull/678) diff --git a/czkawka_core/src/broken_files.rs b/czkawka_core/src/broken_files.rs index 8b22103..e26792b 100644 --- a/czkawka_core/src/broken_files.rs +++ b/czkawka_core/src/broken_files.rs @@ -15,7 +15,7 @@ use pdf::PdfError::Try; use rayon::prelude::*; use serde::{Deserialize, Serialize}; -use crate::common::{open_cache_folder, Common, LOOP_DURATION, PDF_FILES_EXTENSIONS}; +use crate::common::{create_crash_message, open_cache_folder, Common, LOOP_DURATION, PDF_FILES_EXTENSIONS}; use crate::common::{AUDIO_FILES_EXTENSIONS, IMAGE_RS_BROKEN_FILES_EXTENSIONS, ZIP_FILES_EXTENSIONS}; use crate::common_directory::Directories; use crate::common_extensions::Extensions; @@ -477,8 +477,9 @@ impl BrokenFiles { if let Ok(image_result) = result { image_result } else { - println!("Image-rs library crashed when opening \"{:?}\" image, please check if problem happens with latest image-rs version(this can be checked via https://github.com/qarmin/ImageOpening tool) and if it is not reported, please report bug here - https://github.com/image-rs/image/issues", file_entry_clone.path); - file_entry_clone.error_string = "Image crashes due parsing, please check if problem happens with updated https://github.com/qarmin/ImageOpening and later report here https://github.com/image-rs/image/issues".to_string(); + let message = create_crash_message("Image-rs", &file_entry_clone.path.to_string_lossy().to_string(), "https://github.com/Serial-ATA/lofty-rs"); + println!("{message}"); + file_entry_clone.error_string = message; Some(Some(file_entry_clone)) } } @@ -489,28 +490,28 @@ impl BrokenFiles { } Some(Some(file_entry)) } - Err(_inspected) => Some(None) + Err(_inspected) => Some(None), }, TypeOfFile::Audio => match File::open(&file_entry.path) { - Ok(file) => - { - let mut file_entry_clone = file_entry.clone(); + Ok(file) => { + let mut file_entry_clone = file_entry.clone(); - let result = panic::catch_unwind(|| { - if let Err(e) = audio_checker::parse_audio_file(file) { - file_entry.error_string = e.to_string(); - } - Some(Some(file_entry)) - }); - - if let Ok(audio_result) = result { - audio_result - } else { - println!("External parsing audio library crashed when opening \"{:?}\" audio file, please report bug here - https://github.com/qarmin/audio_checker/issues", file_entry_clone.path); - file_entry_clone.error_string = "Audio crashes due parsing, please report bug here - https://github.com/qarmin/audio_checker/issues".to_string(); - Some(Some(file_entry_clone)) + let result = panic::catch_unwind(|| { + if let Err(e) = audio_checker::parse_audio_file(file) { + file_entry.error_string = e.to_string(); } + Some(Some(file_entry)) + }); + + if let Ok(audio_result) = result { + audio_result + } else { + let message = create_crash_message("Symphonia", &file_entry_clone.path.to_string_lossy().to_string(), "https://github.com/pdeljanov/Symphonia"); + println!("{message}"); + file_entry_clone.error_string = message; + Some(Some(file_entry_clone)) } + } Err(_inspected) => Some(None), }, @@ -540,12 +541,13 @@ impl BrokenFiles { if let Ok(pdf_result) = result { pdf_result } else { - println!("PDF-rs library crashed when opening \"{:?}\" pdf, and if it is not reported, please report bug here - https://github.com/pdf-rs/pdf", file_entry_clone.path); - file_entry_clone.error_string = "PDF-rs library crashed when opening pdf, and if it is not reported, please report bug here - https://github.com/pdf-rs/pdf".to_string(); + let message = create_crash_message("PDF-rs", &file_entry_clone.path.to_string_lossy().to_string(), "https://github.com/pdf-rs/pdf"); + println!("{message}"); + file_entry_clone.error_string = message; Some(Some(file_entry_clone)) } } - Err(_inspected) => Some(None) + Err(_inspected) => Some(None), } } diff --git a/czkawka_core/src/common.rs b/czkawka_core/src/common.rs index 3ff4ddc..dd755f9 100644 --- a/czkawka_core/src/common.rs +++ b/czkawka_core/src/common.rs @@ -167,6 +167,10 @@ pub fn split_path(path: &Path) -> (String, String) { } } +pub fn create_crash_message(library_name: &str, file_path: &str, home_library_url: &str) -> String { + format!("{library_name} library crashed when opening \"{file_path}\", please check if this is fixed with the latest version of {library_name} (e.g. with https://github.com/qarmin/crates_tester) and if it is not fixed, please report bug here - {home_library_url}") +} + impl Common { /// Printing time which took between start and stop point and prints also function name #[allow(unused_variables)] diff --git a/czkawka_core/src/same_music.rs b/czkawka_core/src/same_music.rs index 7a024c6..e4cfcd7 100644 --- a/czkawka_core/src/same_music.rs +++ b/czkawka_core/src/same_music.rs @@ -14,7 +14,7 @@ use lofty::{read_from, AudioFile, ItemKey}; use rayon::prelude::*; use serde::{Deserialize, Serialize}; -use crate::common::AUDIO_FILES_EXTENSIONS; +use crate::common::{create_crash_message, AUDIO_FILES_EXTENSIONS}; use crate::common::{open_cache_folder, Common, LOOP_DURATION}; use crate::common_dir_traversal::{CheckingMethod, DirTraversalBuilder, DirTraversalResult, FileEntry, ProgressData}; use crate::common_directory::Directories; @@ -393,7 +393,8 @@ impl SameMusic { } }, Err(_) => { - println!("File {} crashed during reading tags, please report bug", path); + let message = create_crash_message("Lofty", &path, "https://github.com/image-rs/image/issues"); + println!("{message}"); return Some(None); } }; diff --git a/czkawka_core/src/similar_images.rs b/czkawka_core/src/similar_images.rs index 89d4fd9..c9d59c9 100644 --- a/czkawka_core/src/similar_images.rs +++ b/czkawka_core/src/similar_images.rs @@ -20,7 +20,9 @@ use serde::{Deserialize, Serialize}; #[cfg(feature = "heif")] use crate::common::get_dynamic_image_from_heic; -use crate::common::{get_dynamic_image_from_raw_image, open_cache_folder, Common, HEIC_EXTENSIONS, IMAGE_RS_SIMILAR_IMAGES_EXTENSIONS, LOOP_DURATION, RAW_IMAGE_EXTENSIONS}; +use crate::common::{ + create_crash_message, get_dynamic_image_from_raw_image, open_cache_folder, Common, HEIC_EXTENSIONS, IMAGE_RS_SIMILAR_IMAGES_EXTENSIONS, LOOP_DURATION, RAW_IMAGE_EXTENSIONS, +}; use crate::common_directory::Directories; use crate::common_extensions::Extensions; use crate::common_items::ExcludedItems; @@ -563,8 +565,7 @@ impl SimilarImages { if RAW_IMAGE_EXTENSIONS.iter().any(|e| file_name_lowercase.ends_with(e)) { image = match get_dynamic_image_from_raw_image(&file_entry.path) { Some(t) => t, - None => - return Some(Some((file_entry, Vec::new()))) + None => return Some(Some((file_entry, Vec::new()))), }; break 'krztyna; } @@ -599,7 +600,8 @@ impl SimilarImages { return Some(Some((file_entry, Vec::new()))); } } else { - println!("Image-rs library crashed when opening \"{:?}\" image, please check if problem happens with latest image-rs version(this can be checked via https://github.com/qarmin/ImageOpening tool) and if it is not reported, please report bug here - https://github.com/image-rs/image/issues", file_entry.path); + let message = create_crash_message("Image-rs", &file_entry.path.to_string_lossy().to_string(), "https://github.com/image-rs/image/issues"); + println!("{message}"); return Some(Some((file_entry, Vec::new()))); } diff --git a/czkawka_gui/icons/czk_hide_down.svg b/czkawka_gui/icons/czk_hide_down.svg index dd9375f..7b2ced9 100644 --- a/czkawka_gui/icons/czk_hide_down.svg +++ b/czkawka_gui/icons/czk_hide_down.svg @@ -1 +1,105 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + diff --git a/czkawka_gui/icons/czk_hide_up.svg b/czkawka_gui/icons/czk_hide_up.svg index 276895c..4f2933c 100644 --- a/czkawka_gui/icons/czk_hide_up.svg +++ b/czkawka_gui/icons/czk_hide_up.svg @@ -1 +1,113 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + diff --git a/czkawka_gui/icons/czk_settings.svg b/czkawka_gui/icons/czk_settings.svg index a3df7f6..46715fb 100644 --- a/czkawka_gui/icons/czk_settings.svg +++ b/czkawka_gui/icons/czk_settings.svg @@ -1 +1,107 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/czkawka_gui/src/gui_structs/gui_about.rs b/czkawka_gui/src/gui_structs/gui_about.rs index a1cfa95..42abe7b 100644 --- a/czkawka_gui/src/gui_structs/gui_about.rs +++ b/czkawka_gui/src/gui_structs/gui_about.rs @@ -35,6 +35,7 @@ impl GuiAbout { "Peter Blackson", "TheEvilSkeleton", "Ben Bodenmiller", + "ChihWei Wang", "Dan Dascalescu", "Igor", "Kerfuffle", @@ -43,15 +44,16 @@ impl GuiAbout { "0xflotus", "Adam Boguszewski", "Caduser2020", - "ChihWei Wang", "Danny Kirkham", "Dariusz Niedoba", + "Dominik PiÄ…tkowski", "Douman", "Elazar Fine", "Farmadupe", "Gitoffthelawn", "Ivan Habernal", "Jan Jurec", + "Joey Babcock", "Jona", "Jonathan Hult", "Meir Klemfner", diff --git a/czkawka_gui/src/gui_structs/gui_data.rs b/czkawka_gui/src/gui_structs/gui_data.rs index 8c304f2..4744470 100644 --- a/czkawka_gui/src/gui_structs/gui_data.rs +++ b/czkawka_gui/src/gui_structs/gui_data.rs @@ -38,8 +38,8 @@ pub const CZK_ICON_ADD: &[u8; 677] = include_bytes!("../../icons/czk_add.svg"); pub const CZK_ICON_COMPARE: &[u8; 5700] = include_bytes!("../../icons/czk_compare.svg"); pub const CZK_ICON_DELETE: &[u8; 489] = include_bytes!("../../icons/czk_delete.svg"); pub const CZK_ICON_HARDLINK: &[u8; 17326] = include_bytes!("../../icons/czk_hardlink.svg"); -pub const CZK_ICON_HIDE_DOWN: &[u8; 711] = include_bytes!("../../icons/czk_hide_down.svg"); -pub const CZK_ICON_HIDE_UP: &[u8; 634] = include_bytes!("../../icons/czk_hide_up.svg"); +pub const CZK_ICON_HIDE_DOWN: &[u8; 3057] = include_bytes!("../../icons/czk_hide_down.svg"); +pub const CZK_ICON_HIDE_UP: &[u8; 3310] = include_bytes!("../../icons/czk_hide_up.svg"); pub const CZK_ICON_INFO: &[u8; 3325] = include_bytes!("../../icons/czk_info.svg"); pub const CZK_ICON_LEFT: &[u8; 245] = include_bytes!("../../icons/czk_left.svg"); pub const CZK_ICON_MANUAL_ADD: &[u8; 677] = include_bytes!("../../icons/czk_manual_add.svg"); @@ -48,7 +48,7 @@ pub const CZK_ICON_RIGHT: &[u8; 278] = include_bytes!("../../icons/czk_right.svg pub const CZK_ICON_SAVE: &[u8; 462] = include_bytes!("../../icons/czk_save.svg"); pub const CZK_ICON_SEARCH: &[u8; 1517] = include_bytes!("../../icons/czk_search.svg"); pub const CZK_ICON_SELECT: &[u8; 370] = include_bytes!("../../icons/czk_select.svg"); -pub const CZK_ICON_SETTINGS: &[u8; 2851] = include_bytes!("../../icons/czk_settings.svg"); +pub const CZK_ICON_SETTINGS: &[u8; 11677] = include_bytes!("../../icons/czk_settings.svg"); pub const CZK_ICON_STOP: &[u8; 618] = include_bytes!("../../icons/czk_stop.svg"); pub const CZK_ICON_SYMLINK: &[u8; 2455] = include_bytes!("../../icons/czk_symlink.svg"); pub const CZK_ICON_TRASH: &[u8; 709] = include_bytes!("../../icons/czk_trash.svg"); diff --git a/czkawka_gui/ui/about_dialog.ui b/czkawka_gui/ui/about_dialog.ui index 3f2d0a5..8385bc7 100644 --- a/czkawka_gui/ui/about_dialog.ui +++ b/czkawka_gui/ui/about_dialog.ui @@ -1,5 +1,5 @@ - + diff --git a/czkawka_gui/ui/compare_images.ui b/czkawka_gui/ui/compare_images.ui index a912531..916fcfa 100644 --- a/czkawka_gui/ui/compare_images.ui +++ b/czkawka_gui/ui/compare_images.ui @@ -1,5 +1,5 @@ - + diff --git a/czkawka_gui/ui/main_window.ui b/czkawka_gui/ui/main_window.ui index c89f1e5..6dee43b 100644 --- a/czkawka_gui/ui/main_window.ui +++ b/czkawka_gui/ui/main_window.ui @@ -1,5 +1,5 @@ - + diff --git a/czkawka_gui/ui/popover_right_click.ui b/czkawka_gui/ui/popover_right_click.ui index 54b4b17..ea1f216 100644 --- a/czkawka_gui/ui/popover_right_click.ui +++ b/czkawka_gui/ui/popover_right_click.ui @@ -1,5 +1,5 @@ - + diff --git a/czkawka_gui/ui/popover_select.ui b/czkawka_gui/ui/popover_select.ui index bf7507c..064b68f 100644 --- a/czkawka_gui/ui/popover_select.ui +++ b/czkawka_gui/ui/popover_select.ui @@ -1,5 +1,5 @@ - + diff --git a/czkawka_gui/ui/progress.ui b/czkawka_gui/ui/progress.ui index e9df9a6..7b646d5 100644 --- a/czkawka_gui/ui/progress.ui +++ b/czkawka_gui/ui/progress.ui @@ -1,5 +1,5 @@ - + @@ -75,6 +75,7 @@ center + 5 image-missing diff --git a/czkawka_gui/ui/settings.ui b/czkawka_gui/ui/settings.ui index 4f4c25b..60987dd 100644 --- a/czkawka_gui/ui/settings.ui +++ b/czkawka_gui/ui/settings.ui @@ -1,5 +1,5 @@ - + diff --git a/instructions/Compilation.md b/instructions/Compilation.md index c22a47a..62244dc 100644 --- a/instructions/Compilation.md +++ b/instructions/Compilation.md @@ -33,7 +33,7 @@ You need to install Rust via Homebrew, GTK Libraries and optionally heif library /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" brew install rustup rustup-init -brew install gtk+3 adwaita-icon-theme librsvg libheif +brew install gtk4 adwaita-icon-theme librsvg libheif ``` ### Windows diff --git a/instructions/Installation.md b/instructions/Installation.md index 3354f04..05416b1 100644 --- a/instructions/Installation.md +++ b/instructions/Installation.md @@ -29,7 +29,7 @@ One very straight-forward way to do this is by using [Homebrew](https://brew.sh/ Installation in the terminal: ```shell /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" -brew install gtk+3 adwaita-icon-theme ffmpeg librsvg libheif +brew install gtk4 adwaita-icon-theme ffmpeg librsvg libheif ``` After that, go to the location where you downloaded Czkawka and add the `executable` permission to this file. ```shell @@ -41,10 +41,13 @@ At the end execute it: ``` **Warning** -Prebuilt binaries are available only for x86_64, so if you use ARM machine like e.g. Mac M1, you need to compile manually app or install special version of required libraries which can be done via this: +Prebuilt binaries are available only for x86_64, so if you use ARM machine like e.g. Mac M1, you need to compile manually app. + +There is also a way to use x86_64 binaries on ARM, but this require to install special version of required libraries probably via: ```shell -arch -x86_64 /usr/local/bin/brew install gtk+3 adwaita-icon-theme ffmpeg librsvg libheif +arch -x86_64 /usr/local/bin/brew install gtk4 adwaita-icon-theme ffmpeg librsvg libheif ``` +Sadly this doesn't work for all users, so feel free to update this part of documentation(look at https://github.com/qarmin/czkawka/issues/689 and https://github.com/qarmin/czkawka/issues/637 for more info) ### Windows By default, all needed libraries are bundled with the app, inside `windows_czkawka_gui.zip`, but if you compile the app or just move `czkawka_gui.exe`, then you will need to install the `GTK 4`