mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-01 10:23:34 +03:00
Debug Loging
This commit is contained in:
parent
05cd72f4f0
commit
fe5372c867
|
@ -55,12 +55,18 @@ class PcxImageFile(ImageFile.ImageFile):
|
||||||
bbox = i16(s,4), i16(s,6), i16(s,8)+1, i16(s,10)+1
|
bbox = i16(s,4), i16(s,6), i16(s,8)+1, i16(s,10)+1
|
||||||
if bbox[2] <= bbox[0] or bbox[3] <= bbox[1]:
|
if bbox[2] <= bbox[0] or bbox[3] <= bbox[1]:
|
||||||
raise SyntaxError("bad PCX image size")
|
raise SyntaxError("bad PCX image size")
|
||||||
|
if Image.DEBUG:
|
||||||
|
print ("BBox: %s %s %s %s" % bbox)
|
||||||
|
|
||||||
|
|
||||||
# format
|
# format
|
||||||
version = i8(s[1])
|
version = i8(s[1])
|
||||||
bits = i8(s[3])
|
bits = i8(s[3])
|
||||||
planes = i8(s[65])
|
planes = i8(s[65])
|
||||||
stride = i16(s,66)
|
stride = i16(s,66)
|
||||||
|
if Image.DEBUG:
|
||||||
|
print ("PCX version %s, bits %s, planes %s, stride %s" %
|
||||||
|
(version, bits, planes, stride))
|
||||||
|
|
||||||
self.info["dpi"] = i16(s,12), i16(s,14)
|
self.info["dpi"] = i16(s,12), i16(s,14)
|
||||||
|
|
||||||
|
@ -98,6 +104,8 @@ class PcxImageFile(ImageFile.ImageFile):
|
||||||
self.size = bbox[2]-bbox[0], bbox[3]-bbox[1]
|
self.size = bbox[2]-bbox[0], bbox[3]-bbox[1]
|
||||||
|
|
||||||
bbox = (0, 0) + self.size
|
bbox = (0, 0) + self.size
|
||||||
|
if Image.DEBUG:
|
||||||
|
print ("size: %sx%s" % self.size)
|
||||||
|
|
||||||
self.tile = [("pcx", bbox, self.fp.tell(), (rawmode, planes * stride))]
|
self.tile = [("pcx", bbox, self.fp.tell(), (rawmode, planes * stride))]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user