[latex3-commits] [git/LaTeX3-latex3-latex3] main: LuaTeX doesn't like quotes in graphic file names (d3c222bc3)

Joseph Wright joseph.wright at morningstar2.co.uk
Wed Apr 6 14:05:52 CEST 2022


Repository : https://github.com/latex3/latex3
On branch  : main
Link       : https://github.com/latex3/latex3/commit/d3c222bc3fe2c47897ed6d060cd7be6dd308c29b

>---------------------------------------------------------------

commit d3c222bc3fe2c47897ed6d060cd7be6dd308c29b
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Wed Apr 6 13:05:32 2022 +0100

    LuaTeX doesn't like quotes in graphic file names


>---------------------------------------------------------------

d3c222bc3fe2c47897ed6d060cd7be6dd308c29b
 l3backend/l3backend-graphics.dtx | 23 ++++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)

diff --git a/l3backend/l3backend-graphics.dtx b/l3backend/l3backend-graphics.dtx
index 0db28458f..f56c7c478 100644
--- a/l3backend/l3backend-graphics.dtx
+++ b/l3backend/l3backend-graphics.dtx
@@ -161,7 +161,12 @@
 %     \@@_backend_getbb_png:n
 %   }
 % \begin{macro}
-%   {\@@_backend_getbb_auxi:n, \@@_backend_getbb_auxii:n}
+%   {
+%     \@@_backend_getbb_auxi:n   ,
+%     \@@_backend_getbb_auxii:n  ,
+%     \@@_backend_getbb_auxiii:n
+%   }
+% \begin{macro}[EXP]{\@@_backend_dequote:w}
 %   Getting the bounding box here requires us to box up the graphic and
 %   measure it. To deal with the difference in feature support in bitmap
 %   and vector graphics but keeping the common parts, there is a little work
@@ -206,9 +211,18 @@
 %   Measuring the graphic is done by boxing up: for PDF graphics we could
 %   use |\tex_pdfximagebbox:D|, but if doesn't work for other types.
 %   As the box always starts at $(0,0)$ there is no need to worry about
-%   the lower-left position.
+%   the lower-left position. Quotes need to be \emph{removed} as \LuaTeX{}
+%   does not like them here.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_backend_getbb_auxii:n #1
+  {
+    \exp_args:Ne \@@_backend_getbb_auxiii:n
+      { \@@_backend_dequote:w #1 " #1 " \s_@@_stop }
+    \int_const:cn { c_@@_graphics_ #1 \l_@@_graphics_attr_tl _int }
+      { \tex_the:D \tex_pdflastximage:D }
+    \@@_bb_save:x { #1 \l_@@_graphics_attr_tl }
+  }
+\cs_new_protected:Npn \@@_backend_getbb_auxiii:n #1
   {
     \tex_immediate:D \tex_pdfximage:D
       \bool_lazy_or:nnT
@@ -232,13 +246,12 @@
       { \tex_pdfrefximage:D \tex_pdflastximage:D }
     \dim_set:Nn \l_@@_urx_dim { \box_wd:N \l_@@_internal_box }
     \dim_set:Nn \l_@@_ury_dim { \box_ht:N \l_@@_internal_box }
-    \int_const:cn { c_@@_graphics_ #1 \l_@@_graphics_attr_tl _int }
-      { \tex_the:D \tex_pdflastximage:D }
-    \@@_bb_save:x { #1 \l_@@_graphics_attr_tl }
   }
+\cs_new:Npn \@@_backend_dequote:w #1 " #2 " #3 \s_@@_stop {#2}
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
+% \end{macro}
 %
 % \begin{macro}
 %   {





More information about the latex3-commits mailing list.