-
Notifications
You must be signed in to change notification settings - Fork 5
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
Leptonica 1.83.0 #6
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#5 ```bash LD_LIBRARY_PATH="$(pwd)/../../DanBloomberg/leptonica/local/lib" PKG_CONFIG_PATH="$(pwd)/../../DanBloomberg/leptonica/local/lib/pkgconfig" cargo test ```
I think this is clearer.
I don't think that was safe. Someone could have initialized a new instance and then called the method, which would have been unsafe.
same as what I did with Pix. So that I can use the original name for the trait.
The c interface feels old fashioned
In the process I had to change how borrowed box wrapper works. It's now returned as a ref counted value, so it suddenly needs to implement drop.
I'll need to do the same for Box as well. It turns out I need all 3 cases for tesseract (Cloned (implments drop), Borrowed and Normal).
I'll need to do this from tesseract-plumbing
It's not correct as it needs to perform validation. And I don't like that it could panic
``` LD_LIBRARY_PATH="$(pwd)/../../DanBloomberg/leptonica/local/lib" PKG_CONFIG_PATH="$(pwd)/../../DanBloomberg/leptonica/local/lib/pkgconfig" bash -c 'cargo test --release && valgrind --leak-check=yes --error-exitcode=1 --leak-check=full --show-leak-kinds=all "$(find target/*/deps/ -executable -name 'leptonica_plumbing-*')"' ```
I noticed that imagelib_versions could return NULL, so handle that. Document testing with valgrind
But in doing so, I found that I wasn't consistent and thought of a better way.
It's nice not to have the behaviour traits (BorrowedPix(a)) with this redesign.
Don't replace it, as it's now documented in the code.
Useful for Leptess which gets pix from 2 different methods and wants to store them the same way.
It's a breaking change, and this has been stable for long enough
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refactor to support leptonica-1.83.0.
Leptonica 1.83.0 removed field access from the public API, which meant we now need to go through Leptonica's methods for more things.
DanBloomberg/leptonica@e8b670d
#5
Additionally, this allowed me to re-evaluate how we abstract Leptonica's memory patterns. I've introduced the 3 memory wrappers
RefCounted
,RefCountedExclusive
andBorrowedFrom
. I think this is simpler, and more correct.There will be additional PRs coming
https://github.com/ccouzens/tesseract-plumbing/compare/leptonica_1.83.0
houqp/leptess@master...leptonica_1.83.0
https://github.com/antimatter15/tesseract-rs (no PR, not affected)