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,325
  • 1
  • 15
  • 10

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
  • 431,103
  • 135
  • 960
  • 1,075