0

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

Dirk

Dirk Einecke
  • 2,335
  • 1
  • 15
  • 11

1 Answers1

2

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?

Community
  • 1
  • 1
Pekka
  • 442,112
  • 142
  • 972
  • 1,088