I'm looking for information regarding the jpeg file format.
What I'm trying to do is to extract the pixel size and density from any jpeg
file. Now I'm getting the problem that there are variants on the format -
each with its own set of segment ids.
The reasson I need the pixel density is that I'm trying to add jpeg files
into pdf files, using a tool called pdfrw. Pdfrw accepts a scale factor
something like this:
img src=fred.jpg scale=50
where 50 would reduce the size to 50% of the original. The trouble is,
pdfrw is ignoring the pixel density of the image (which is probably fair
enough from its point of view). However, I''m trying to work out the scale
factor to use by finding the pixel size of the image and dividing it into
the size of the area it has to fit into. If the image says "I'm 1800 by
1200 pixels", then pdfrw makes it a big image regardless of whether the
pixel density is 300 by 300, or 150 by 150. (Maybe I should contact the
authors of pdfrw.) If I can extract the pixel density as well as the pixel
size, then I can work out the physial dimensions (in mm or (brain dead)
imperial units), and thus scale the image to fit its appropriate area of
the final image.
This all has to be done programatically, rather than manually, so right
clicking in Konqueror (a browser) on an image, and looking at the values
So, I need some pointers to descriptions of the file format, and where I can
find the image size AND pixel density in the file, preferably regardless of
whether its a jfif, an exif, or what.
Rock Computer Consultancy