robertknight / ocrs

Rust library and CLI tool for OCR (extracting text from images)
Apache License 2.0
1.09k stars 44 forks source link

Turn examples/hello_ocrs into a package #66

Closed pythcoiner closed 3 months ago

pythcoiner commented 4 months ago

this PR turn hello_ocrs into a package, so user do no have to guess dependencies version.

robertknight commented 4 months ago

The dependency versions of the existing example are listed in the Cargo.toml file.

Did you encounter a problem with that?

pythcoiner commented 4 months ago

The dependency versions of the existing example are listed in the Cargo.toml file.

Did you encounter a problem with that?

in fact i see that while preparing this PR, i just feel it's more clear w/ a package but understand if you prefer the actual way.

And thanks for this wonderfull project!

robertknight commented 4 months ago

in fact i see that while preparing this PR, i just feel it's more clear w/ a package but understand if you prefer the actual way.

I would prefer to keep this as an example in the ocrs crate for the time being, as it means one less file to update.

If the examples end up needing significantly different dependencies or configuration in future, I would probably put them all in an ocrs-examples crate.

wsyxbcl commented 3 months ago

It seems that ocrs on crates.io differs slightly from the one on GitHub? Notably, ImageSource is missing in the crates.io version's lib.rs, causing issues for users who build the example by using ocrs from crates.io

pythcoiner commented 3 months ago

It seems that ocrs on crates.io differs slightly from the one on GitHub? Notably, ImageSource is missing in the crates.io version's lib.rs, causing issues for users who build the example by using ocrs from crates.io

i think i already hit this issue but IIRC @robertknight already merge a fix on master

robertknight commented 3 months ago

Hello. I will clear up the confusion soon by publishing a new release. In the interim, if you are using ocrs from crates.io, please see the version of the example from the Git tag of the last release.

You can also find the example code that corresponds to the latest release on docs.rs. Probably the best solution here would be for the "Usage" section to link to the example on docs.rs rather than on GitHub. That way it would always be in-sync with the crate version.

robertknight commented 3 months ago

I have released Ocrs v0.7.0 which aligns the published crate with the example in the repository. Going forwards I will try to reduce breaking API changes to avoid this kind of confusion. Please let me know if you run into problems with the latest version.

I'm going to close this for the moment for the reason given in https://github.com/robertknight/ocrs/pull/66#issuecomment-2094861114.