Skip to content

Commit

Permalink
Merge 11399b1 into bbe07d4
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Aug 13, 2017
2 parents bbe07d4 + 11399b1 commit 549bffe
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions PIL/SgiImagePlugin.py
Expand Up @@ -104,6 +104,11 @@ def _save(im, fp, filename):
z = len(im.mode)
if dim == 1 or dim == 2:
z = 1
# assert we've got the right number of bands.
if len(im.getbands()) != z:
raise ValueError("incorrect number of bands in SGI write: %s vs %s" %
(z, len(im.getbands())))

# Minimum Byte value
pinmin = 0
# Maximum Byte value (255 = 8bits per pixel)
Expand Down Expand Up @@ -131,11 +136,6 @@ def _save(im, fp, filename):

fp.write(struct.pack('404s', b'')) # dummy

# assert we've got the right number of bands.
if len(im.getbands()) != z:
raise ValueError("incorrect number of bands in SGI write: %s vs %s" %
(z, len(im.getbands())))

for channel in im.split():
fp.write(channel.tobytes())

Expand Down

0 comments on commit 549bffe

Please sign in to comment.