From b8049efe62431549fcefc8df060a351f512962c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mikrut?= <41945903+qarmin@users.noreply.github.com> Date: Mon, 25 Jan 2021 11:32:10 +0100 Subject: [PATCH] Remove checking for ico in similar images (#227) --- czkawka_core/src/broken_files.rs | 2 +- czkawka_core/src/similar_images.rs | 4 ++-- instructions/Instruction.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/czkawka_core/src/broken_files.rs b/czkawka_core/src/broken_files.rs index 20ac886..cd97872 100644 --- a/czkawka_core/src/broken_files.rs +++ b/czkawka_core/src/broken_files.rs @@ -663,7 +663,7 @@ fn load_cache_from_file(text_messages: &mut Messages) -> Option TypeOfFile { // Checking allowed image extensions - let allowed_image_extensions = [".jpg", ".jpeg", ".png", ".bmp", ".ico", ".tiff", ".pnm", ".tga", ".ff", ".gif"]; + let allowed_image_extensions = [".jpg", ".jpeg", ".png", ".bmp", ".tiff", ".pnm", ".tga", ".ff", ".gif"]; let allowed_archive_zip_extensions = [".zip"]; // Probably also should work [".xz", ".bz2"], but from my tests they not working let allowed_audio_extensions = [".mp3", ".flac", ".wav", ".ogg"]; // Probably also should work [".xz", ".bz2"], but from my tests they not working if allowed_image_extensions.iter().any(|e| file_name_lowercase.ends_with(e)) { diff --git a/czkawka_core/src/similar_images.rs b/czkawka_core/src/similar_images.rs index 2dd84ec..28b42c0 100644 --- a/czkawka_core/src/similar_images.rs +++ b/czkawka_core/src/similar_images.rs @@ -265,8 +265,8 @@ impl SimilarImages { .to_lowercase(); // Checking allowed image extensions - let allowed_image_extensions = ["jpg", "jpeg", "png", "bmp", "ico", "tiff", "pnm", "tga", "ff", "gif"]; - if !allowed_image_extensions.iter().any(|e| file_name_lowercase.ends_with(format!(".{}", e).as_str())) { + let allowed_image_extensions = [".jpg", ".jpeg", ".png", ".bmp", ".tiff", ".pnm", ".tga", ".ff", ".gif"]; + if !allowed_image_extensions.iter().any(|e| file_name_lowercase.ends_with(e)) { continue 'dir; } diff --git a/instructions/Instruction.md b/instructions/Instruction.md index b31faee..18ff29d 100644 --- a/instructions/Instruction.md +++ b/instructions/Instruction.md @@ -113,7 +113,7 @@ Then, for each selected tag by which we want to search for duplicates, we perfor ### Similar Images It is a tool for finding similar images that differ e.g. in watermark, size etc. -The tool first collects images with specific extensions that can be checked - `["jpg", "png", "bmp", "ico", "tiff"]`. +The tool first collects images with specific extensions that can be checked - `[".jpg", ".jpeg", ".png", ".bmp", ".tiff", ".pnm", ".tga", ".ff", ".gif"]`. Next cached data are loaded from file to prevent hashing twice same file. Automatically cache which points to non existing data is deleted.