mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-12 10:16:17 +03:00
add some comments
This commit is contained in:
parent
f3fe22d2f2
commit
75286a4e40
|
@ -310,6 +310,12 @@ class EpsImageFile(ImageFile.ImageFile):
|
||||||
# Check for an "ImageData" descriptor
|
# Check for an "ImageData" descriptor
|
||||||
# https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/#50577413_pgfId-1035096
|
# https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/#50577413_pgfId-1035096
|
||||||
|
|
||||||
|
# If we've already read an "ImageData" descriptor,
|
||||||
|
# don't read another one.
|
||||||
|
if imagedata_size:
|
||||||
|
bytes_read = 0
|
||||||
|
continue
|
||||||
|
|
||||||
# Values:
|
# Values:
|
||||||
# columns
|
# columns
|
||||||
# rows
|
# rows
|
||||||
|
@ -320,10 +326,6 @@ class EpsImageFile(ImageFile.ImageFile):
|
||||||
# binary/ascii (1: binary, 2: ascii)
|
# binary/ascii (1: binary, 2: ascii)
|
||||||
# data start identifier (the image data follows after a single line
|
# data start identifier (the image data follows after a single line
|
||||||
# consisting only of this quoted value)
|
# consisting only of this quoted value)
|
||||||
if imagedata_size:
|
|
||||||
bytes_read = 0
|
|
||||||
continue
|
|
||||||
|
|
||||||
image_data_values = byte_arr[11:bytes_read].split(None, 7)
|
image_data_values = byte_arr[11:bytes_read].split(None, 7)
|
||||||
columns, rows, bit_depth, mode_id = (
|
columns, rows, bit_depth, mode_id = (
|
||||||
int(value) for value in image_data_values[:4]
|
int(value) for value in image_data_values[:4]
|
||||||
|
@ -339,6 +341,8 @@ class EpsImageFile(ImageFile.ImageFile):
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
# Read the columns and rows after checking the bit depth and mode
|
||||||
|
# in case the bit depth and/or mode are invalid.
|
||||||
imagedata_size = columns, rows
|
imagedata_size = columns, rows
|
||||||
elif bytes_mv[:5] == b"%%EOF":
|
elif bytes_mv[:5] == b"%%EOF":
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in New Issue
Block a user