mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-04-28 04:53:41 +03:00
dpi key should only be present when there is resolution info in the BMP header.
This commit is contained in:
parent
92b070ceaf
commit
61be1d8b19
|
@ -98,6 +98,8 @@ class BmpImageFile(ImageFile.ImageFile):
|
||||||
self.size = self.size[0], 2**32 - self.size[1]
|
self.size = self.size[0], 2**32 - self.size[1]
|
||||||
direction = 0
|
direction = 0
|
||||||
|
|
||||||
|
self.info["dpi"] = tuple(map(lambda x: math.ceil(x / 39.3701), pxperm))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
raise IOError("Unsupported BMP header type (%d)" % len(s))
|
raise IOError("Unsupported BMP header type (%d)" % len(s))
|
||||||
|
|
||||||
|
@ -164,7 +166,6 @@ class BmpImageFile(ImageFile.ImageFile):
|
||||||
(rawmode, ((self.size[0]*bits+31)>>3)&(~3), direction))]
|
(rawmode, ((self.size[0]*bits+31)>>3)&(~3), direction))]
|
||||||
|
|
||||||
self.info["compression"] = compression
|
self.info["compression"] = compression
|
||||||
self.info["dpi"] = tuple(map(lambda x: math.ceil(x / 39.3701), pxperm))
|
|
||||||
|
|
||||||
def _open(self):
|
def _open(self):
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user