[texhax] includegraphics and image scaling

Peter Davis pfd at pfdstudio.com
Fri Dec 10 00:07:42 CET 2010


On Thu, Dec 9, 2010 at 6:08 PM, Heiko Oberdiek <
heiko.oberdiek at googlemail.com> wrote:

> On Thu, Dec 09, 2010 at 05:12:07PM -0500, Peter Davis wrote:
>
> > On Thu, Dec 9, 2010 at 4:51 PM, Martin Schröder <martin at oneiros.de>
> wrote:
> >
> > > 2010/12/9 Peter Davis <pfd at pfdstudio.com>:
> > > > I have a couple of .jpg files that are 1024 x 768 pixels, with a
> > > resolution
> > > > of 96dpi.  If I just include them in my LaTeX document with:
> > > > \includegraphics{xyz.jpg}
> > > > they appear on the page at 1024bp x 768bp.  In effect, the resolution
> is
> > > > ignored, and they're scaled up by 1/3.
>
> > > What's the output of
> > > - "identify -verbose" (from imagemagick)
>
> > Image: Chrysanthemum.jpg
> >   Geometry: 1024x768+0+0
> >   Resolution: 72x72
> >   Print size: 14.2222x10.6667
> >   Units: PixelsPerInch
>
> The resolution is 72dpi, not 96dpi.
>


Interesting.  The Windows Photo Viewer clearly lists it as 96dpi
horizontally and vertically:

[image: WindowsPhotoViewer.gif]


I've run into this before ... where different tools report different
resolutions for JPEG files.  If memory serves, ImageMagick always reported
72dpi, whereas the IJG JPEG Library reported something else.  I think this
is the result of multiple file formats with potentially inconsistent fields.


> width = (1024 dots / 72 (dots/in)) = 14.2222 in
> Unit conversion: 1in = 72bp
> ==> width = 1024bp
>
> Therefore the image is shown in the correct size on the paper.
> The graphicx package allows you to scale the image,
> see options `scale' or `width'.
> Documentation of LaTeX's graphics bundle in file `grfguide.pdf'.
>

Yes, that's the document I've been looking at.

Thanks!

-pd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/texhax/attachments/20101209/dfc64cb1/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: WindowsPhotoViewer.gif
Type: image/gif
Size: 39722 bytes
Desc: not available
URL: <http://tug.org/pipermail/texhax/attachments/20101209/dfc64cb1/attachment-0001.gif>


More information about the texhax mailing list