mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-17 02:34:44 +03:00
Remove inline comments
This commit is contained in:
parent
aba2d2b098
commit
3ab47512a0
|
@ -86,25 +86,24 @@ def _save(im, fp, filename):
|
||||||
if im.mode != "RGB" and im.mode != "RGBA" and im.mode != "L":
|
if im.mode != "RGB" and im.mode != "RGBA" and im.mode != "L":
|
||||||
raise ValueError("Unsupported SGI image mode")
|
raise ValueError("Unsupported SGI image mode")
|
||||||
|
|
||||||
im = im.transpose(Image.FLIP_TOP_BOTTOM) # Flip the image, since the origin of SGI
|
im = im.transpose(Image.FLIP_TOP_BOTTOM)
|
||||||
# file is the bottom-left corner
|
|
||||||
|
|
||||||
magicNumber = 474 # Define the file as SGI File Format
|
magicNumber = 474
|
||||||
rle = 0 # Run-Length Encoding Compression - Unsupported
|
rle = 0
|
||||||
bpc = 1 # Byte-per-pixel precision, 1 = 256bits per pixel
|
bpc = 1
|
||||||
dim = 3 # Number of dimensions (x,y,z)
|
dim = 3
|
||||||
x, y = im.size # X Dimension / Y Dimension
|
x, y = im.size
|
||||||
if im.mode == "L" and y == 1:
|
if im.mode == "L" and y == 1:
|
||||||
dim = 1
|
dim = 1
|
||||||
elif im.mode == "L":
|
elif im.mode == "L":
|
||||||
dim = 2
|
dim = 2
|
||||||
z = len(im.mode) # Z Dimension: Number of channels
|
z = len(im.mode)
|
||||||
if dim == 1 or dim == 2:
|
if dim == 1 or dim == 2:
|
||||||
z = 1
|
z = 1
|
||||||
pinmin = 0 # Minimum Byte value
|
pinmin = 0
|
||||||
pinmax = 255 # Maximum Byte value
|
pinmax = 255
|
||||||
imgName = os.path.splitext(os.path.basename(filename))[0][0:78] # Image name (79 characters max)
|
imgName = os.path.splitext(os.path.basename(filename))[0][0:78]
|
||||||
colormap = 0 # Standard representation of pixel in the file
|
colormap = 0
|
||||||
channels = []
|
channels = []
|
||||||
for channelIndex in range(0, z):
|
for channelIndex in range(0, z):
|
||||||
channelData = list(im.getdata(channelIndex))
|
channelData = list(im.getdata(channelIndex))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user