From df44f9c3423ab84b791209d70dfda2168a597aa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mikrut?= <41945903+qarmin@users.noreply.github.com> Date: Sat, 6 Feb 2021 14:24:15 +0100 Subject: [PATCH] Update list of checked images (#252) --- czkawka_core/src/broken_files.rs | 2 +- czkawka_core/src/similar_images.rs | 2 +- instructions/Instruction.md | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/czkawka_core/src/broken_files.rs b/czkawka_core/src/broken_files.rs index a1b9524..66aae64 100644 --- a/czkawka_core/src/broken_files.rs +++ b/czkawka_core/src/broken_files.rs @@ -665,7 +665,7 @@ fn load_cache_from_file(text_messages: &mut Messages) -> Option TypeOfFile { // Checking allowed image extensions - let allowed_image_extensions = [".jpg", ".jpeg", ".png", ".bmp", ".tiff", ".pnm", ".tga", ".ff", ".gif"]; + let allowed_image_extensions = [".jpg", ".jpeg", ".png", ".bmp", ".tiff", ".tif", ".pnm", ".tga", ".ff", ".gif", ".jif", ".jfi", ".ico", ".webp", ".avif"]; 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 28b42c0..b03e84e 100644 --- a/czkawka_core/src/similar_images.rs +++ b/czkawka_core/src/similar_images.rs @@ -265,7 +265,7 @@ impl SimilarImages { .to_lowercase(); // Checking allowed image extensions - let allowed_image_extensions = [".jpg", ".jpeg", ".png", ".bmp", ".tiff", ".pnm", ".tga", ".ff", ".gif"]; + let allowed_image_extensions = [".jpg", ".jpeg", ".png", ".bmp", ".tiff", ".tif", ".pnm", ".tga", ".ff", ".gif", ".jif", ".jfi"]; 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 18ff29d..ea10df2 100644 --- a/instructions/Instruction.md +++ b/instructions/Instruction.md @@ -113,12 +113,12 @@ 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", ".jpeg", ".png", ".bmp", ".tiff", ".pnm", ".tga", ".ff", ".gif"]`. +The tool first collects images with specific extensions that can be checked - `[".jpg", ".jpeg", ".png", ".bmp", ".tiff", ".tif", ".pnm", ".tga", ".ff", ".gif", ".jif", ".jfi", ".ico", ".webp", ".avif"]`. Next cached data are loaded from file to prevent hashing twice same file. Automatically cache which points to non existing data is deleted. -Then a perceptual hash is created for each image which isn't availavle in cache. +Then a perceptual hash is created for each image which isn't available in cache. Cryptographic hash (used for example in ciphers) for similar inputs gives completely different outputs 11110 ==> AAAAAB @@ -146,7 +146,7 @@ If an error happens when opening this file then it means that this file is corru Only some file extensions are supported, because I rely on external crates. Also some false positives may be shown(e.g. https://github.com/image-rs/jpeg-decoder/issues/130) so always open file to check if it is really broken. ## Config/Cache files -For now Czkawka store only 2 files on disk: +For now Czkawka store few config and cache files on disk: - `czkawka_gui_config.txt` - stores configuration of GUI which may be loaded at startup - `cache_similar_image.txt` - stores cache data and hashes which may be used later without needing to compute image hash again - editing this file may cause app crashes. - `cache_broken_files.txt` - stores cache data of broken files