Skip to content

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

Open
SerinaNya wants to merge 6 commits into
guofei9987:masterfrom
SerinaNya:master
Open

add feature: images can now be loaded from the bytes() object#105
SerinaNya wants to merge 6 commits into
guofei9987:masterfrom
SerinaNya:master

Conversation

@SerinaNya

@SerinaNya SerinaNya commented Apr 1, 2023

Copy link
Copy Markdown
  • 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
Copy Markdown
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
Copy Markdown
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