[texhax] includegraphics and image scaling

Peter Davis pfd at pfdstudio.com
Fri Dec 10 21:10:05 CET 2010


On Fri, Dec 10, 2010 at 3:10 PM, Heiko Oberdiek <
heiko.oberdiek at googlemail.com> wrote:

> On Fri, Dec 10, 2010 at 07:35:23AM +0100, Heiko Oberdiek wrote:
>
> > On Thu, Dec 09, 2010 at 11:12:36PM -0500, Peter Davis wrote:
> >
> > > http://www.pfdstudio.com/images/Chrysanthemum.jpg
> >
> > Quick results of:
> >
> > * file:
> >   JPEG image data, JFIF standard 1.02, resolution (DPI), 96 x 96
> > * bmpsize-test:
> >   Type: jpg
> >   Pixel width: 1024 px
> >   Pixel height: 768 px
> >   Density x: 96 dots per 72.27pt
> >   Density y: 96 dots per 72.27pt
> >   Width: 767.99854 bp
> >   Height: 575.99863 bp
> > pdfTeX:
> >   770.87813pt, 578.15858pt
> > XeTeX:
> >   1027.83746pt, 770.87813pt
> > ImageMagick 5.5.7:
> >     x-Resolution: 72/1
> >     y-Resolution: 72/1
> >   Resolution: 96x96 pixels/inch
>
> Analysis:
>
> 0x0000: APP0 (length 16)
>  JFIF-Header
>  * Unit: dots per inch
>  * Xdensity: 96
>  * Ydensity: 96
>  * no thumbnail
> 0x0014: APPE (length 14)
>  Adobe Application-Specific JPEG Marker
> 0x0024: APP1 (length 4957)
>  Exif with TIFF-Header
>  No resolution unit that means the default is 1in.
>  XResolution: 72
>  YResolution: 72
> ...
>
> Conclusion: The problem is the image file itself that contains
> contradictory data about the resolution. Some programs
> are using 96 dpi from the JFIF header, others are using
> 72 dpi from the EXIF data.
>

Thank you, Heiko.  I agree that having both JFIF and EXIF data is
over-specifying the information, and creates opportunities for such
inconsistencies.  In fact, files with such inconsistencies are *very*
common.  I've run into this situation, and had to code around it, many times
over the years.

There should be some consensus on which overrides which in cases where the
image is inconsistent.  It seems that much of the more widely used software
(Photoshop, InDesign, Windows, pdfTeX, the IJG JPEG library, etc.) use the
JFIF data, while ImageMagick and XeTeX use the EXIF data.

Thanks,
-pd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/texhax/attachments/20101210/73a37817/attachment.html>


More information about the texhax mailing list