Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example code in documentation not running #21

Closed
ndortega opened this issue Aug 22, 2017 · 6 comments
Closed

Example code in documentation not running #21

ndortega opened this issue Aug 22, 2017 · 6 comments

Comments

@ndortega
Copy link

I'm trying to run the example code and was unable to circumvent this error: "the trait img_hash::HashImage is not implemented for image::DynamicImage". Could you look into this??

screen shot 2017-08-22 at 11 40 44 am

@abonander
Copy link
Owner

abonander commented Aug 22, 2017

Type errors like this usually mean a version mismatch; the version of the image crate that you're using isn't the same version that img_hash is using (it needs updating pretty badly but that probably means yet another major version bump; don't go to 1.0 before your public dependencies, kids). Try using image = "0.13" in your Cargo.toml and see if it builds then.

@rasky
Copy link

rasky commented Jul 21, 2018

Found this. Currently, img_hash requires image <= 0.13 in its Cargo.toml. Any reason for forcing this? It means it doesn't work with latest image version which is 0.19.

@abonander
Copy link
Owner

Not particularly, I just haven't updated it. In fact, on the 3-alpha branch I expanded the version range to include 0.19 and it works just fine.

I was slightly worried it would be a breaking change but that's only an issue if someone has image = "*" in their dependencies and runs cargo update, but that's not really img_hash's problem.

I'll update this with a minor release, since it's a backwards-compatible change to the public API.

@rasky
Copy link

rasky commented Jul 21, 2018

FWIW, image = * is the suggested way to add the image crate (see their README). I suggest that you find a more future proof way to declare the dependency or you’ll have to track upstream even if they don’t break the API.

@abonander
Copy link
Owner

That's really not my problem. It's the user's responsibility to pin the version they've built against or accept breakages on arbitrary upgrades. Cargo should really be warning about wildcard dependency versions. My goal with img_hash is to provide as wide of a dependency range compatibility as possible.

@abonander
Copy link
Owner

Published 2.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants