Possible Duplicate:
How to detect page zoom level in all modern browsers?
I'm building a website with an image that needs to have the same physical size on every device or browser. Let's say the image perfectly fits on an iPhone5 screen, i.e. it's physical size is 3.49x1.96 inches (or 4" diagonal). If I look at it on my laptop's browser, it also needs to have the size of 3.49x1.96 inches (obviously suffering from lower resolution). On an iPhone4 with a smaller screen, it would even cut of some parts of the image.
I guess I would need to get the PPI/DPI and then adjust it accordingly, i.e. if the device has have the PPI/DPI of the iphone5, I need to resize the image to 50%. I'm a bit confused, though, whether I need to take the screen resolution into account as well, as it can be changes on non mobile devices. Can anyone help me out here?
What would be a a good approach to make this work on all devices?