Hi all
Is there any way to get the dpi or the width/height in inches/point size of a jpg? I know I can use GD and get the width and height in pixels, which is fine for display to the screen...But I need to get images from a user, put them into a pdf file for printing high quality (or as high a quality as the original image is). I need to keep the image at the original size, and only scale it down if it is too big. If I load the image into LView I can view the dpi and size in inches so I know it is possible to work out real size or get from the jpg file itself? I have tried to use the GD getimagesize, but the results are not consistant ie if I have two images the same size in inches, but with different dpi (say 72 and 150) then gd reports the size of the 72dpi as half of the size of the one thats 150dpi (so there is a relation!) but there is no way to work out a scale factor to get the real size. I mean even if I could get the screen resolution and multiply by the pixel width then these images would still work out at different sizes according to GD getimagesize.
I would like to do this from within PHP on Linux so either a class or by running a shell script/utility and getting the results. I even tried using a tclsh script and read in the sof to get the width and height, but it gave back pixel measurement ?? If anybody knows how to read the resolution in binary from the jpg that would also work!
Any help greatly appreciated as this is driving me mental!
thanks
ricki