首页 > 解决方案 > 为什么 DPI 信息返回为 (1,1) 而图像属性显示为 (96,96)?

问题描述

我从 pdf 文件中提取原始数据,并在 python 中将 PDF 的第一页转换为 Tiff/Jpeg/PNG。通过利用 popploer 包。

images = convert_from_path(file[i],poppler_path=r'C:\Users\User\poppler-0.68.0_x86\poppler-0.68.0\bin')
images_first_page=images[0]
images_first_page.save('C:/Users/User/Documents/folder' +'.tif', 'TIFF')

img = Image.open('C:/Users/User/Documents/../...tif')
print(img.info)

结果:

{'compression': 'raw', 'dpi': (1, 1), 'resolution': (1, 1)} 

但是,查看图像属性:

图片属性截图

它显示为 96 dpi,96 dpi,不确定(1,1)在我的情况下是什么意思。

标签: pythonimage-processingpython-imaging-librarytiffdpi

解决方案


推荐阅读