I stumbled across this thread while looking through my blogs referrer logs and just wanted to leave a little note about the link to my blog post Jason Byrnes posted pointing to there.
That function was designed for use with JPEG images and wrote while looking at the file header specs of a JPEG image. It works on the same principle as the function referred to by SOJO web.
A digital camera is probably producing TIFF, RAW, or some other format images unless it's a point-n-shoot camera or a cellphone camera. Better cameras generally don't produce JPEG images because JPEG is a format that trashes some information and generates the displayed image using algorithms in order to save filesize where as TIFF/RAW/etc are "lossless" formats that store every single pixel in the image file.
I'm not familiar with the inner workings of these image formats, but if they store DPI information it should be in a standard location that can be read just like the JPEG DPI functions mentioned in this thread do.