Skip to content

Commit e610395

Browse files
committed
Fixed broken similarity hashing
Bumped version to v0.5.11
1 parent f4ce578 commit e610395

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## [0.5.11] - 2022-12-
5+
6+
### Fixed
7+
8+
- Similarity calculation was broken for some time, fixed it
9+
410
## [0.5.10] - 2022-12-21
511

612
### Fixed

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "image_sieve"
3-
version = "0.5.10"
3+
version = "0.5.11"
44
authors = ["Florian Fetz <florian.fetz@googlemail.com>"]
55
description = "GUI based tool to sort out and categorize images, raw images and videos"
66
repository = "https://github.com/Futsch1/image-sieve"
@@ -32,6 +32,7 @@ imagepipe = "0.5.0"
3232
dark-light = "0.2"
3333
strum = "0.24"
3434
strum_macros = "0.24"
35+
image-23 = { version = "=0.23", package="image" }
3536

3637
[dev-dependencies]
3738
base64 = "0.13"

src/synchronize.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::item_sort_list::ItemList;
22
use crate::persistence::settings::Settings;
3-
use img_hash::image::GenericImageView;
3+
use image_23::GenericImageView;
44
use img_hash::HashAlg;
55
use img_hash::Hasher;
66
use img_hash::HasherConfig;
@@ -201,7 +201,7 @@ fn calculate_similar_hashes(item_list: Arc<Mutex<ItemList>>, settings: &Settings
201201
{
202202
let item_list_loc = item_list.lock().unwrap();
203203
for item in &item_list_loc.items {
204-
if item.is_image() && !item.has_hash() {
204+
if (item.is_image() || item.is_raw_image()) && !item.has_hash() {
205205
image_file_names.push(item.path.clone());
206206
}
207207
}
@@ -210,7 +210,7 @@ fn calculate_similar_hashes(item_list: Arc<Mutex<ItemList>>, settings: &Settings
210210
// Now calculate the hashes
211211
let mut hashes: HashMap<PathBuf, ImageHash<Vec<u8>>> = HashMap::new();
212212
for image_file_name in image_file_names {
213-
if let Ok(image) = img_hash::image::open(&image_file_name) {
213+
if let Ok(image) = image_23::open(&image_file_name) {
214214
// The hash size is dependent on the image orientation to increase the result quality
215215
let (hash_width, hash_height) = if image.width() > image.height() {
216216
(16, 8)

0 commit comments

Comments
 (0)