[luatex] Override image resolution?

Reinhard Kotucha reinhard.kotucha at web.de
Sun Jun 19 01:51:26 CEST 2016

On 2016-06-18 at 12:13:29 +0200, Patrick Gundlach wrote:

 > Hi all,
 > some images (jpg) have a broken resolution field. Now when loading
 > the image in LuaTeX (0.79), I get strange results for img.width and
 > img.height, probably because of the resolution.
 > Is there a way to force a resolution (300x300 for example) when
 > loading an image and ignore the setting in the file?

Hi Patrick,
what I would try first is to check whether other programs like sam2p
or convert (ImageMagigck) can process the broken files properly.

Maybe it's even possible to use convert(1) in order to convert from
JPEG to JPEG.  I can imagine that ImageMagigck tries to repair the
broken entries, at least if they are obviously wrong.

What happens if you run

 convert foo.jpg -resize 100% foo2.jpg

? Do you get a different result?

If you are using one of the programs mentioned above in order to
convert to PDF directly, check whether the /MediaBox looks reasonable.

There are many things one can try.


Reinhard Kotucha                            Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover                    mailto:reinhard.kotucha at web.de

More information about the luatex mailing list