Open
Conversation
|
OSError: cannot identify image file <_io.BytesIO object at 0x02A0DE40> As far as I am concerned, sio is still a StringIO(). If you are trying to open it as an image, try opening it with line = Image.open(name), where name is the actual name of the image, not a StringIO(). |
1 similar comment
mochp
approved these changes
Jan 15, 2018
Owner
|
@xingchenxuanfeng 多谢,能否解释一下,为什么多线程要这样加 target 就可以? |
|
我也是同样的错误,求解答 |
Author
|
@Skyexu 这个是语法问题吧,之前你的写法相当于先调用了methods.run_algorithm()这个函数,然后把这个方法的返回值传进Thread类里,正确的写法是把这个methods.run_algorithm函数作为一个变量穿进去。 |
Author
|
@passengerxlb 这个我也不知道,感觉是api版本的问题,你的版本好像不能识别stringIO作为输入直接生成PIL图像。 |
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
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.
优化速度
1.不需要保存截图再读取,直接把图片二进制数据给PIL
2.之前的多线程处理有问题,实际上还是单线程,没有正确使用多线程
Signed-off-by: xc xc@XC-PC