1
0
Fork 0
mirror of synced 2024-05-12 00:13:06 +12:00

Remove checking for ico in similar images (#227)

This commit is contained in:
Rafał Mikrut 2021-01-25 11:32:10 +01:00 committed by GitHub
parent 49ddc041ee
commit b8049efe62
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View file

@ -663,7 +663,7 @@ fn load_cache_from_file(text_messages: &mut Messages) -> Option<HashMap<String,
fn check_extension_avaibility(file_name_lowercase: &str) -> TypeOfFile { fn check_extension_avaibility(file_name_lowercase: &str) -> TypeOfFile {
// Checking allowed image extensions // 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_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 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)) { if allowed_image_extensions.iter().any(|e| file_name_lowercase.ends_with(e)) {

View file

@ -265,8 +265,8 @@ impl SimilarImages {
.to_lowercase(); .to_lowercase();
// Checking allowed image extensions // 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"];
if !allowed_image_extensions.iter().any(|e| file_name_lowercase.ends_with(format!(".{}", e).as_str())) { if !allowed_image_extensions.iter().any(|e| file_name_lowercase.ends_with(e)) {
continue 'dir; continue 'dir;
} }

View file

@ -113,7 +113,7 @@ Then, for each selected tag by which we want to search for duplicates, we perfor
### Similar Images ### Similar Images
It is a tool for finding similar images that differ e.g. in watermark, size etc. 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. Next cached data are loaded from file to prevent hashing twice same file.
Automatically cache which points to non existing data is deleted. Automatically cache which points to non existing data is deleted.