Skip to content

Commit

Permalink
Fix logical error in image size check
Browse files Browse the repository at this point in the history
在检查图片尺寸时,原本重复检查了两次长度,修正为长+宽
  • Loading branch information
Keycatowo committed Apr 20, 2024
1 parent b68b14b commit 3f87016
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions blind_watermark/att.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def anti_cut_att_old(input_filename, output_file_name, origin_shape):
input_img = cv2.imread(input_filename)
output_img = input_img.copy()
output_img_shape = output_img.shape
if output_img_shape[0] > origin_shape[0] or output_img_shape[0] > origin_shape[0]:
if output_img_shape[0] > origin_shape[0] or output_img_shape[1] > origin_shape[1]:
print('裁剪打击后的图片,不可能比原始图片大,检查一下')
return

Expand All @@ -204,7 +204,7 @@ def anti_cut_att(input_filename=None, input_img=None, output_file_name=None, ori
input_img = cv2.imread(input_filename)
output_img = input_img.copy()
output_img_shape = output_img.shape
if output_img_shape[0] > origin_shape[0] or output_img_shape[0] > origin_shape[0]:
if output_img_shape[0] > origin_shape[0] or output_img_shape[1] > origin_shape[1]:
print('裁剪打击后的图片,不可能比原始图片大,检查一下')
return

Expand Down

0 comments on commit 3f87016

Please sign in to comment.