img_hash icon indicating copy to clipboard operation
img_hash copied to clipboard

Add support for `image-rs 0.24`

Open qarmin opened this issue 3 years ago • 4 comments

Since the latest version of image-rs library require Rust 1.56.0, I think that img_hash also should use Rust 2021 edition and bump minimal requirements.

For now I can't use image-rs 0.24.0, because img_hash crate cannot interoperate with this version and I have such errors(this works with 0.23)

error[E0277]: the trait bound `image::DynamicImage: Image` is not satisfied
   --> czkawka_core/src/similar_images.rs:606:50
    |
606 |                     let hash = hasher.hash_image(&image);
    |                                       ---------- ^^^^^^ the trait `Image` is not implemented for `image::DynamicImage`
    |                                       |
    |                                       required by a bound introduced by this call

qarmin avatar Feb 03 '22 08:02 qarmin

For anyone wanting to use library with updated dependencies I created repo which use image 0.24.2 and have other libraries updated(logic is not changed) https://github.com/qarmin/img_hash https://crates.io/crates/image_hasher/

qarmin avatar May 29 '22 06:05 qarmin

@qarmin : Is there any reason you chose to publish a new crate instead of contributing to this one ? I opened a pull request with your changes.

lovasoa avatar Jul 16 '22 21:07 lovasoa

@lovasoa This crate is not very well maintained. I wish the author would add some co-maintainers. Though what worked out for me was simply using img_hash::image and then simply take the contents and construct a borrowed image from it. That way it's automatically compatible with all image versions.

CryZe avatar Jul 16 '22 21:07 CryZe

@abonander , would you be open to adding some co-maintainers ?

lovasoa avatar Jul 16 '22 22:07 lovasoa