mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 01:16:16 +03:00
Added comments to explain overhead_len
This commit is contained in:
parent
d49884e40c
commit
c056406f21
|
@ -749,7 +749,7 @@ def _save(im: Image.Image, fp: IO[bytes], filename: str | bytes) -> None:
|
||||||
MAX_BYTES_IN_MARKER = 65533
|
MAX_BYTES_IN_MARKER = 65533
|
||||||
xmp = info.get("xmp")
|
xmp = info.get("xmp")
|
||||||
if xmp:
|
if xmp:
|
||||||
overhead_len = 29
|
overhead_len = 29 # b"http://ns.adobe.com/xap/1.0/\x00"
|
||||||
max_data_bytes_in_marker = MAX_BYTES_IN_MARKER - overhead_len
|
max_data_bytes_in_marker = MAX_BYTES_IN_MARKER - overhead_len
|
||||||
if len(xmp) > max_data_bytes_in_marker:
|
if len(xmp) > max_data_bytes_in_marker:
|
||||||
msg = "XMP data is too long"
|
msg = "XMP data is too long"
|
||||||
|
@ -759,7 +759,7 @@ def _save(im: Image.Image, fp: IO[bytes], filename: str | bytes) -> None:
|
||||||
|
|
||||||
icc_profile = info.get("icc_profile")
|
icc_profile = info.get("icc_profile")
|
||||||
if icc_profile:
|
if icc_profile:
|
||||||
overhead_len = 14
|
overhead_len = 14 # b"ICC_PROFILE\0" + o8(i) + o8(len(markers))
|
||||||
max_data_bytes_in_marker = MAX_BYTES_IN_MARKER - overhead_len
|
max_data_bytes_in_marker = MAX_BYTES_IN_MARKER - overhead_len
|
||||||
markers = []
|
markers = []
|
||||||
while icc_profile:
|
while icc_profile:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user