This seems to be a GD library issue. The function imageresolution seems to return incorrect values. So far I have only been able to observe this in Jpeg format. An image was read in which had a 72-DPI resolution, this was interpreted by imageresolution as 96-DPI. This problem did not occur with PNG files.