With view-raw-logs@1x.png I can see the optional pHYs chunk (3779 pixels per meter in both x and y = 95.9866 dpi), but your app doesn’t write to EXIF.
There are a couple of related Go issues:
- image/png: no support for setting and retrieving the PPI/DPI · Issue #18365 · golang/go · GitHub
- proposal: image: decoding options · Issue #27830 · golang/go · GitHub
If would be handy if image.Config included the resolution values, but I doubt that will ever happen.
bep wrote an experimental (incomplete) package to read EXIF, XMP, and IPTC:
https://github.com/bep/imagemeta
The alternatives (including what we’re using today) do not have the desired feature set, and are (for the most part), abandoned.
If this package gets legs, perhaps we could access format specific metadata. For example:
.Exif.ImageDescription # applicable to all formats
.XMP.Title # applicable to all formats
.PNG.PixelsPerMeterX # applicable to PNG
.PNG.PixelsPerMeterY # applicable to PNG
.JPEG.DensityX # applicable to JPEG
.JPEG.DensityY # applicable to JPEG
.JPEG.DensityUnits # applicable to JPEG
Or something…