How to define DPi for a new JPG image?

前端 未结 1 344
Happy的楠姐
Happy的楠姐 2021-01-27 07:54

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条回答
  •  面向向阳花
    2021-01-27 08:38

    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?

    0 讨论(0)
提交回复
热议问题