This repository was archived by the owner on Jan 12, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 380
ctb-android-changes #96
Open
kmfree
wants to merge
2
commits into
card-io:master
Choose a base branch
from
kmfree:android-change
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Binary file not shown.
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does
tessdata
need these extra permissions? Is the data not stored within the SDK itself?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tessdata is an external directory read in by Tesseract. It needs to be included with the app/assets/bundle. With android the only way to do this is have it on the sd card or emulated storage build into most devices. Read/write external in this case does not mean external storage but rather the external emulated storage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be no need to write it to external storage, the internal private storage for the app should be fine. I've had to do something similar with an OpenVPN binary that needs to read a configuration file from disk, it does need to be written to storage instead of the assets directory so it can be accessed as a file, but from the point of view of the app, internal storage should be ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an issue with tesseract, not an inability to read from assets. C/C++ can do what you described. However to my knowledge Tesseract specifically does not. It is platform agnostic so it cannot use AssetManager/NDK without referencing android specific apis. I will look into adding this functionality with some flags/magic if that is the desired. It should also be noted that this is not writing to external storage. It is internal to the phone, not the apk. The write permission is required to do that. It may require code changes to tesseract. The current solution is the agreed method outside of changing the tesseract source. Having said that I am in agreement that this is sort of a stupid solution to something you would think would be more straight forward as it is with ios version.
Some relevant discussion on the topic: http://stackoverflow.com/questions/23174318/how-to-get-a-full-path-for-an-android-resource-file-init-tesseract-ocr-in-andro