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

Extend ability to process image from disk to from disk and memory #255

Open
jingchaoluan opened this issue Oct 24, 2017 · 1 comment
Open

Comments

@jingchaoluan
Copy link

Now the code can only process image coming from disk (image path) directly, but sometimes we need to process an image from memory (such as an image object or a file-like object).

Expected Behavior

@Checks() function before functions 'read_image_gray()' and 'read_image_binary()' can not only pass 'string' type image (image path coming from disk), but also pass 'object' type image (image object coming from memory)

Current Behavior

For code lines (#155, #194) @Checks() before functions 'read_image_gray()' and 'read_image_binary()', the current parameter value 'str' in @Checks() indicates that only a 'string' type image (the image path in local disk) can pass the checks() function and then be read. It will limit the code can only process image coming from disk.

Possible Solution

On code lines #155 and #194, change the first parameter value in @Checks() from 'str' to '{str, object}'. Thus for images coming from memory (objects) can also be check correctly and then be read.

Steps to Reproduce (for bugs)

Your Environment

  • Python version: 2.7.12
  • Git revision of ocropy: ebd8235
  • Operating System and version: Ubuntu Linux 16.04
@jingchaoluan jingchaoluan changed the title Extend ability to process image from disk and memory Extend ability to process image from disk to from disk and memory Oct 24, 2017
@zuphilip
Copy link
Collaborator

Pull request is here: #260

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

2 participants