[pdftex] Error when including image with bogus resolution
Max Chernoff
tex at maxchernoff.ca
Thu Jan 16 13:46:41 CET 2025
Hi all,
(Context: https://tex.stackexchange.com/q/734919)
If an image has a way too small resolution, pdfTeX includes it
incorrectly and issues a warning:
pdfTeX warning: pdftex: arithmetic: number too big
Instead of giving an unclear warning and failing to properly include the
image, it would be better to treat this like a too large resolution and
to issue a warning and reset the resolution.
Test file:
%% Generate with ImageMagick:
%% for n in $(seq 1 6); do
%% convert -units PixelsPerInch -size 1000x1000 xc:#ff0000 -density $n test-$n.jpg
%% done
\pdfximage{test-1.jpg}\pdfrefximage\pdflastximage\eject
\pdfximage{test-2.jpg}\pdfrefximage\pdflastximage\eject
\pdfximage{test-3.jpg}\pdfrefximage\pdflastximage\eject
\pdfximage{test-4.jpg}\pdfrefximage\pdflastximage\eject
\pdfximage{test-5.jpg}\pdfrefximage\pdflastximage\eject
\pdfximage{test-6.jpg}\pdfrefximage\pdflastximage\bye
Patch attached. ("resolution_ratio" is a terrible name; hopefully you
can think of something better)
Thanks,
-- Max
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pdftex-small-resolution.patch
Type: text/x-patch
Size: 1221 bytes
Desc: not available
URL: <https://tug.org/pipermail/pdftex/attachments/20250116/5962e283/attachment.bin>
More information about the pdftex
mailing list.