Where the DPI is stored
JPG files can store the resolution in two places: the JFIF header and the EXIF data written by cameras and phones. PNG files use a block called pHYs. This checker reads all of them and tells you which one it found, because programs do not always agree: Photoshop reads EXIF first, while many other apps read JFIF.
DPI is not image quality
Two files with the same pixels look identical on screen, whatever their DPI says. What decides print quality is how many pixels you have for the size you want. That is why this tool shows the largest size your image can print at 300 DPI (sharp, close up) and 150 DPI (fine for posters seen from a distance).