python - 为什么 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)
在我的情况下是什么意思。
解决方案
推荐阅读
- kubernetes - 如何使响应缓存在 wso2am-3.1.0 中工作?(am-pattern-2)
- html - 多级垫表在第一次排序后不会扩展到另一个级别
- sharepoint - 使用 Power Automate 比较两个 Excel 文件
- google-apps-script - 使用 Google Apps 脚本签署对 Coinbase Pro API 的调用
- c# - 为什么 .NET Core WinForms 设计器在 VS2019 中停止工作?
- c# - 使用模型绑定和 POST 请求在每个表行上实现删除按钮
- javascript - 为什么 socket.on 函数会重复?
- docker - kubernetes 和 terraform 设置中的多个 vue.js 容器返回 404 或 502
- javascript - 如何避免在 React 中重新渲染组件?
- spring-boot - @KafkaListener 的序列化