How to define DPi for a new JPG image?

↘锁芯ラ 提交于 2019-12-20 06:47:35

问题


I'm going to create a new JPG image with PHP. How can I set the DBi value of a new JPG image.

Dirk


回答1:


JPG is a Pixel format that doesn't really know physical dimensions like Dots Per Inch.

All you can do is write a dpi value into the file's Metadata as assistance for further processing, but it's just a recommendation and it can't be done using the GD library.

You would have to use an third-party library for this. See e.g. the second answer to this question: How do I add exif data to an image?



来源:https://stackoverflow.com/questions/5077189/how-to-define-dpi-for-a-new-jpg-image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!