Skip to content

Commit

Permalink
make clear that compression_ratio is int
Browse files Browse the repository at this point in the history
  • Loading branch information
guofei9987 committed Dec 24, 2023
1 parent 01306ca commit 4aa9940
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion blind_watermark/blind_watermark.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def read_wm(self, wm_content, mode='img'):

self.bwm_core.read_wm(self.wm_bit)

def embed(self, filename=None, compression_ratio=None):
def embed(self, filename=None, compression_ratio: int = 100):
"""
:param filename: string
Save the image file as filename
Expand All @@ -62,6 +62,8 @@ def embed(self, filename=None, compression_ratio=None):
:return:
"""
embed_img = self.bwm_core.embed()
if compression_ratio == 100:
compression_ratio = None
if filename is not None:
if compression_ratio is None:
cv2.imwrite(filename=filename, img=embed_img)
Expand Down

0 comments on commit 4aa9940

Please sign in to comment.