How to define DPi for a new JPG image?
问题 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