[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2023-01-19 00:52:38 +00:00
parent de43bc99c8
commit 41b3ac8aed
2 changed files with 5 additions and 5 deletions

View File

@ -381,7 +381,7 @@ def test_custom_comment():
output_stream.seek(0) output_stream.seek(0)
data = output_stream.read() data = output_stream.read()
# Lazy method to determine if the comment is in the image generated # Lazy method to determine if the comment is in the image generated
assert(bytes(unique_comment, "utf-8") in data) assert bytes(unique_comment, "utf-8") in data
def test_plt_marker(): def test_plt_marker():
@ -400,13 +400,13 @@ def test_plt_marker():
break break
jp2_boxid = struct.unpack(">H", box_bytes)[0] jp2_boxid = struct.unpack(">H", box_bytes)[0]
if jp2_boxid == 0xff4f: if jp2_boxid == 0xFF4F:
# No length specifier for main header # No length specifier for main header
continue continue
elif jp2_boxid == 0xff58: elif jp2_boxid == 0xFF58:
# This is the PLT box we're looking for # This is the PLT box we're looking for
return return
elif jp2_boxid == 0xff93: elif jp2_boxid == 0xFF93:
break break
# SOD box encountered and no PLT, so it wasn't found # SOD box encountered and no PLT, so it wasn't found

View File

@ -353,7 +353,7 @@ def _save(im, fp, filename):
signed, signed,
fd, fd,
comment, comment,
add_plt add_plt,
) )
ImageFile._save(im, fp, [("jpeg2k", (0, 0) + im.size, 0, kind)]) ImageFile._save(im, fp, [("jpeg2k", (0, 0) + im.size, 0, kind)])