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

add feature: images can now be loaded from the bytes() object #105

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

SerinaNya
Copy link

@SerinaNya SerinaNya commented Apr 1, 2023

  • add feature: images can now be loaded from the bytes() object
  • update README_cn.md
  • have NOT updated README.md yet

@SerinaNya SerinaNya changed the title add feature: better bytes experience add feature: images can now be loaded from the bytes() object Apr 4, 2023
@guofei9987
Copy link
Owner

Thanks for this. A merge request is always welcome.
But I do not get it why bytes is needed. It was designed to read 3D-matrix image. See this https://github.com/guofei9987/blind_watermark/blob/master/examples/example_no_writing.py

@SerinaNya
Copy link
Author

If only 3D-matrix images can be passed in, the user must convert the image to something like a cv2 object first. If the wrong parameters are used when reading the image using cv2, the blind_watermark will not work properly.

In my case, your lib is used with a web framework which returns the image uploaded by the user as a bytes object. Therefore I created this PR.

如果只接受 3D-matrix 对象,那么使用者必须事先将图片转换为 cv2 对象之类的。如果使用 cv2 读取图像时提供的参数错误,将导致你的库无法正常工作。
我是将你的库和 Web 框架一起使用,Web 框架会将用户上传的图片以 bytes 对象的形式返回给我。

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

Successfully merging this pull request may close these issues.

2 participants