Comment #3 on issue 12519 by patri...@
gmail.com: Get/Set VerticalResolution and HorizontalResolution (DPI) in an image
https://bugs.chromium.org/p/skia/issues/detail?id=12519#c3the Horizontal and Vertical resolutions are important when you scan, print or need to transform coordinates in an image.
Some examples :
You rasterize a pdf at 300 dpi into a jpg, the coordinates of the objects in a pdf are in 72dpi, so you need the image resolution to put annotations or other added objects at the right place.
You scan an image to 600 dpi, then you want to print it at the original dimension.
Clues for implementation :
BMP : In the bitmap header, you have PelsPerMeterX and PelsPerMeterY
Png : LibPng have png_set_pHYs png_get_pHYs
Jpg : LibJpeg jpeg_compress_struct Y_density X_density density_unit
Tiff : libTiff tag TIFFTAG_XRESOLUTION TIFFTAG_YRESOLUTION TIFFTAG_RESOLUTIONUNIT