mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-21 20:54:47 +03:00
Fix: Allow TIFF plugin to write DPI values with floating point
This commit is contained in:
parent
8354fa4929
commit
ab7b38f4fc
|
@ -1519,8 +1519,8 @@ def _save(im, fp, filename):
|
||||||
dpi = im.encoderinfo.get("dpi")
|
dpi = im.encoderinfo.get("dpi")
|
||||||
if dpi:
|
if dpi:
|
||||||
ifd[RESOLUTION_UNIT] = 2
|
ifd[RESOLUTION_UNIT] = 2
|
||||||
ifd[X_RESOLUTION] = int(dpi[0] + 0.5)
|
ifd[X_RESOLUTION] = dpi[0]
|
||||||
ifd[Y_RESOLUTION] = int(dpi[1] + 0.5)
|
ifd[Y_RESOLUTION] = dpi[1]
|
||||||
|
|
||||||
if bits != (1,):
|
if bits != (1,):
|
||||||
ifd[BITSPERSAMPLE] = bits
|
ifd[BITSPERSAMPLE] = bits
|
||||||
|
|
Loading…
Reference in New Issue
Block a user