on Windows I use exiftool. For a png saved at 300 dpi it gives me the following info: the resolution is reported as 11811 dots per meter, which is close to 300 dpi.
C:\Odds_and_Ends>exiftool \windows\temp\bitmap300.png ExifTool Version Number : 10.31 File Name : bitmap300.png Directory : /windows/temp File Size : 36 kB File Modification Date/Time : 2018:09:19 18:51:49-04:00 File Access Date/Time : 2018:09:19 18:51:48-04:00 File Creation Date/Time : 2018:09:19 18:51:44-04:00 File Permissions : rw-rw-rw- File Type : PNG File Type Extension : png MIME Type : image/png Image Width : 2480 Image Height : 3508 Bit Depth : 8 Color Type : RGB with Alpha Compression : Deflate/Inflate Filter : Adaptive Interlace : Noninterlaced Significant Bits : 8 8 8 8 Pixels Per Unit X : 11811 Pixels Per Unit Y : 11811 Pixel Units : meters Software : www.inkscape.org Image Size : 2480x3508 Megapixels : 8.7
-- Sent from: http://inkscape.13.x6.nabble.com/Inkscape-Dev-f2781808.html