Skip to content
This repository was archived by the owner on Nov 8, 2021. It is now read-only.

Conversation

@LuxunHuang
Copy link

I add a type bytes, then user can read file by itself.
For example, I use opencv to capture image from ipcam, then change it type from ndarray to bytes.

I = ipcam.getframe()
I = cv2.resize(I, (720, 480))
Ibyte = cv2.imencode(".jpg", I)[1].tostring()

@lebronJ lebronJ self-assigned this Oct 16, 2018
@lebronJ
Copy link
Contributor

lebronJ commented Oct 16, 2018

Hi @LuxunHuang, thanks for your contribution.

  1. Could you please also take care of the comments in this query?
  2. Can you confirm this works both under Python 3.6 (& 3.7) and Python 2.7?

@lefnire
Copy link

lefnire commented Feb 16, 2019

@LuxunHuang when I use this patch, I get stat: embedded null character in path because the os.path.isfile(image) comes before your check; and image at that point is bytes. Just need to have your elif block come before the isfile check

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants