texlive[73494] Build/source/texk/web2c/pdftexdir: warn and ignore
commits+karl at tug.org
commits+karl at tug.org
Fri Jan 17 23:51:46 CET 2025
Revision: 73494
https://tug.org/svn/texlive?view=revision&revision=73494
Author: karl
Date: 2025-01-17 23:51:46 +0100 (Fri, 17 Jan 2025)
Log Message:
-----------
warn and ignore too-small image resolutions; from Max Chernoff
Modified Paths:
--------------
trunk/Build/source/texk/web2c/pdftexdir/ChangeLog
trunk/Build/source/texk/web2c/pdftexdir/NEWS
trunk/Build/source/texk/web2c/pdftexdir/pdftex.web
Modified: trunk/Build/source/texk/web2c/pdftexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/ChangeLog 2025-01-17 22:28:29 UTC (rev 73493)
+++ trunk/Build/source/texk/web2c/pdftexdir/ChangeLog 2025-01-17 22:51:46 UTC (rev 73494)
@@ -1,3 +1,10 @@
+2025-01-17 Max Chernoff <tex at maxchernoff.ca>
+
+ * pdftex.web (Glob..., Set init...): new global
+ resolution_ratio==226.
+ (scale_image): use it to report a warning for too-small resolutions
+ (e.g., 1px x 1px). https://tex.stackexchange.com/questions/734919
+
2024-08-04 Thanh Han The <hanthethanh at gmail.com>
* pdftoepdf.cc (write_epdf): reversed sep and pdfkeyprefix.
Modified: trunk/Build/source/texk/web2c/pdftexdir/NEWS
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/NEWS 2025-01-17 22:28:29 UTC (rev 73493)
+++ trunk/Build/source/texk/web2c/pdftexdir/NEWS 2025-01-17 22:51:46 UTC (rev 73494)
@@ -4,6 +4,8 @@
entries use an _ instead of ., as in PTEX_Fullbanner.
- bugfixes:
- increase tolerance for detecting interword spaces in overfull lines.
+ - ignore tiny resolutions like 1x1 embedded in images instead of
+ exceeding \maxdimen.
pdfTeX 3.141592653-2.6-1.40.26 (TeX Live 2024)
- bugfixes:
Modified: trunk/Build/source/texk/web2c/pdftexdir/pdftex.web
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/pdftex.web 2025-01-17 22:28:29 UTC (rev 73493)
+++ trunk/Build/source/texk/web2c/pdftexdir/pdftex.web 2025-01-17 22:51:46 UTC (rev 73494)
@@ -15787,6 +15787,7 @@
@!ten_pow: array[0..9] of integer; {$10^0..10^9$}
@!scaled_out: integer; {amount of |scaled| that was taken out in
|divide_scaled|}
+@!resolution_ratio: integer; {(1in in sp)/|\maxdimen|}
@!init_pdf_output: boolean;
@!adv_char_width_s: integer; {to save result of calculation done in |adv_char_width| }
@!adv_char_width_s_out: scaled;
@@ -15795,6 +15796,7 @@
one_bp := 65782; {65781.76}
one_hundred_bp := 6578176;
one_hundred_inch := 473628672;
+resolution_ratio := 226;
ten_pow[0] := 1;
for i := 1 to 9 do
ten_pow[i] := 10*ten_pow[i - 1];
@@ -34429,6 +34431,13 @@
end;
if (x <= 0) or (y <= 0) or (xr < 0) or (yr < 0) then
pdf_error("ext1", "invalid image dimensions");
+ if (x / resolution_ratio >= xr) or (y / resolution_ratio >= yr) then begin
+ {It's better to warn and ignore too-small resolutions given in
+ the image file, usually 1dpi x 1dpi, to avoid arithmetic overflow.}
+ xr := 0;
+ yr := 0;
+ pdf_warning("ext1", "too small image resolution ignored", true, true);
+ end;
if is_pdf_image(image) then begin
w := x;
h := y;
More information about the tex-live-commits
mailing list.