Use _binary instead of struct

This commit is contained in:
Andrew Murray 2022-12-03 09:31:05 +11:00
parent 976ad5746a
commit c1d0a00943

View File

@ -732,7 +732,7 @@ def _save(im, fp, filename):
icc_profile = icc_profile[MAX_DATA_BYTES_IN_MARKER:] icc_profile = icc_profile[MAX_DATA_BYTES_IN_MARKER:]
i = 1 i = 1
for marker in markers: for marker in markers:
size = struct.pack(">H", 2 + ICC_OVERHEAD_LEN + len(marker)) size = o16(2 + ICC_OVERHEAD_LEN + len(marker))
extra += ( extra += (
b"\xFF\xE2" b"\xFF\xE2"
+ size + size