mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 18:06:18 +03:00
If DPI isn't in JPEG header, fetch from EXIF
This commit is contained in:
parent
92acfca46f
commit
07a9620959
|
@ -117,6 +117,11 @@ def APP(self, marker):
|
|||
# plus constant header size
|
||||
self.info["mpoffset"] = self.fp.tell() - n + 4
|
||||
|
||||
# If DPI isn't in JPEG header, fetch from EXIF
|
||||
if "dpi" not in self.info and "exif" in self.info:
|
||||
x_resolution = self._getexif()[0x011A]
|
||||
self.info["dpi"] = x_resolution[0] / x_resolution[1]
|
||||
|
||||
|
||||
def COM(self, marker):
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue
Block a user