[latex3-commits] [l3svn] 01/02: Support for multi-page images (PDF inclusion)

noreply at latex-project.org noreply at latex-project.org
Mon May 15 15:53:31 CEST 2017


This is an automated email from the git hooks/post-receive script.

joseph pushed a commit to branch master
in repository l3svn.

commit fb941b3eb242ffd47a55247e178d771496e87061
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Mon May 15 13:34:13 2017 +0100

    Support for multi-page images (PDF inclusion)
---
 l3kernel/l3drivers.dtx                  |  126 ++++++++++++++++++++++++-------
 l3kernel/testfiles/m3expl001.luatex.tlg |    6 +-
 l3kernel/testfiles/m3expl001.tlg        |    6 +-
 l3kernel/testfiles/m3expl001.xetex.tlg  |    5 +-
 l3kernel/testfiles/m3expl003.luatex.tlg |    6 +-
 l3kernel/testfiles/m3expl003.tlg        |    6 +-
 l3kernel/testfiles/m3expl003.xetex.tlg  |    5 +-
 l3trial/l3image/l3image.dtx             |   76 +++++++++++++------
 8 files changed, 175 insertions(+), 61 deletions(-)

diff --git a/l3kernel/l3drivers.dtx b/l3kernel/l3drivers.dtx
index 5595dd6..917a3b2 100644
--- a/l3kernel/l3drivers.dtx
+++ b/l3kernel/l3drivers.dtx
@@ -692,37 +692,75 @@
 %
 % \subsection{Images}
 %
+% \begin{variable}{\l_@@_image_attr_tl}
+%   In PDF mode, additional atributes of an image (such as page number) are
+%   needed both to obtain the bounding box and when inserting the image: this
+%   occurs as the image dictionary approach means they are read as part of
+%   the bounding box operation. As such, it is easier to track additional
+%   attributes using a dedicated |tl| rather than build up the same data
+%   twice.
+%    \begin{macrocode}
+\tl_new:N \l_@@_image_attr_tl
+%    \end{macrocode}
+% \end{variable}
+%
 % \begin{macro}[int]
 %   {\@@_image_getbb_jpg:n, \@@_image_getbb_pdf:n, \@@_image_getbb_png:n}
-% \begin{macro}[aux]{\@@_image_getbb_jpg_aux:n}
+% \begin{macro}[aux]
+%   {\@@_image_getbb_auxi:n, \@@_image_getbb_auxii:n}
 %   Getting the bounding box here requires us to box up the image and
-%   measure it.
+%   measure it. To deal with the difference in feature support in bitmap
+%   and vector images but keeping the common parts, there is a little work
+%   to do in terms of auxiliaries. The key here is to notice that we need
+%   two forms of the attributes: a \enquote{short} set to allow us to
+%   track for caching, and the full form to pass to the primitive. Note that
+%   in |pdftex.def| the short reference is stored to be used in the inclusion
+%   stage: may be required when there are more aspects to track.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_image_getbb_jpg:n #1
   {
-    \int_if_exist:cTF { c__image_ #1 _int }
+    \int_zero:N \l__image_page_int
+    \tl_clear:N \l_@@_image_attr_tl
+    \@@_image_getbb_auxi:n {#1}
+  }
+\cs_new_eq:NN \@@_image_getbb_png:n \@@_image_getbb_jpg:n
+\cs_new_protected:Npn \@@_image_getbb_pdf:n #1
+  {
+    \tl_set:Nx \l_@@_image_attr_tl
       {
-        \dim_set_eq:Nc \l__image_urx_dim { c__image_ #1 _urx__dim }
-        \dim_set_eq:Nc \l__image_ury_dim { c__image_ #1 _ury__dim }
+        \int_compare:nNnT \l__image_page_int > 0
+          { :P \int_use:N \l__image_page_int }
       }
-      { \@@_image_getbb_jpg_aux:n {#1} }
+    \@@_image_getbb_auxi:n {#1}
   }
-\cs_new_protected:Npn \@@_image_getbb_jpg_aux:n #1
+\cs_new_protected:Npn \@@_image_getbb_auxi:n #1
   {
-    \tex_immediate:D \pdftex_pdfximage:D {#1}
+    \int_if_exist:cTF { c__image_ #1 \l_@@_image_attr_tl _int }
+      {
+        \dim_set_eq:Nc \l__image_urx_dim
+          { c__image_ #1 \l_@@_image_attr_tl _urx__dim }
+        \dim_set_eq:Nc \l__image_ury_dim
+          { c__image_ #1 \l_@@_image_attr_tl _ury__dim }
+      }
+      { \@@_image_getbb_auxii:n {#1} }
+  }
+\cs_new_protected:Npn \@@_image_getbb_auxii:n #1
+  {
+    \tex_immediate:D \pdftex_pdfximage:D
+      \int_compare:nNnT \l__image_page_int > 0
+        { page ~ \int_use:N \l__image_page_int }
+      {#1}
     \hbox_set:Nn \l__image_tmp_box
       { \pdftex_pdfrefximage:D \pdftex_pdflastximage:D }
-    \int_const:cn { c__image_ #1 _int }
+    \int_const:cn { c__image_ #1 \l_@@_image_attr_tl _int }
       { \tex_the:D \pdftex_pdflastximage:D }
     \dim_set:Nn \l__image_urx_dim { \box_wd:N \l__image_tmp_box }
     \dim_set:Nn \l__image_ury_dim { \box_ht:N \l__image_tmp_box }
-    \dim_const:cn { c__image_ #1 _urx__dim }
+    \dim_const:cn { c__image_ #1 \l_@@_image_attr_tl _urx__dim }
       { \l__image_urx_dim }
-    \dim_const:cn { c__image_ #1 _ury__dim }
+    \dim_const:cn { c__image_ #1 \l_@@_image_attr_tl _ury__dim }
       { \l__image_ury_dim }
   }
-\cs_new_eq:NN \@@_image_getbb_pdf:n \@@_image_getbb_jpg:n
-\cs_new_eq:NN \@@_image_getbb_png:n \@@_image_getbb_jpg:n
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
@@ -730,12 +768,13 @@
 % \begin{macro}[int]
 %   {\@@_image_include_jpg:n, \@@_image_include_pdf:n, \@@_image_include_png:n}
 %   Images are already loaded for the measurement part of the code, so
-%   inclusion is straight-forward.
+%   inclusion is straight-forward, with only any attributes to worry about. The
+%   latter carry through from determination of the bounding box.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_image_include_jpg:n #1
   {
     \pdftex_pdfrefximage:D
-      \int_use:c { c__image_ #1 _int }
+      \int_use:c { c__image_ #1 \l_@@_image_attr_tl _int }
   }
 \cs_new_eq:NN \@@_image_include_pdf:n \@@_image_include_jpg:n
 \cs_new_eq:NN \@@_image_include_png:n \@@_image_include_jpg:n
@@ -894,8 +933,12 @@
 %    \begin{macrocode}
 \cs_new_eq:NN \@@_image_getbb_eps:n \__image_read_bb:n
 %<*dvipdfmx>
-\cs_new_eq:NN \@@_image_getbb_jpg:n \__image_extract_bb:n
-\cs_new_eq:NN \@@_image_getbb_pdf:n \__image_extract_bb:n
+\cs_new_protected:Npn \@@_image_getbb_jpg:n
+  {
+    \int_zero:N \l__image_page_int
+    \__image_extract_bb:n
+  }
+\cs_new_eq:NN \@@_image_getbb_pdf:n \@@_image_getbb_jpg:n
 \cs_new_eq:NN \@@_image_getbb_png:n \__image_extract_bb:n
 %</dvipdfmx>
 %    \end{macrocode}
@@ -919,7 +962,15 @@
 \cs_new_protected:Npn \@@_image_include_pdf:n #1
   { \@@_image_include_aux:nn {#1} { epdf } }
 \cs_new_protected:Npn \@@_image_include_aux:nn #1#2
-  { \tex_special:D { pdf:#2~(#1) } }
+  {
+    \tex_special:D
+      {
+        pdf:#2~
+        \int_compare:nNnT \l__image_page_int > 0
+          { page ~ \int_use:N \l__image_page_int \c_space_tl }
+        (#1)
+      }
+  }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
@@ -965,37 +1016,54 @@
 %
 % \begin{macro}[int]
 %   {\@@_image_getbb_jpg:n, \@@_image_getbb_pdf:n, \@@_image_getbb_png:n}
-% \begin{macro}[aux]{\@@_image_getbb_auxi:nN, \@@_image_getbb_auxi:nN}
+% \begin{macro}[aux]{\@@_image_getbb_auxi:nN}
+% \begin{macro}[aux]{\@@_image_getbb_auxii:nnN, \@@_image_getbb_auxii:VnN}
+% \begin{macro}[aux]{\@@_image_getbb_auxiiii:nNnn, \@@_image_getbb_auxiv:nNnn}
 %   For \texttt{xdvipdfmx}, there are two primitives that allow us to obtain
-%   the bounding box without needing \texttt{extractbb}.
+%   the bounding box without needing \texttt{extractbb}. The only complexity
+%   is passing the various minor variations to a common core process.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_image_getbb_jpg:n #1
-  { \@@_image_getbb_aux:nN {#1} \xetex_picfile:D }
+  {
+    \int_zero:N \l__image_page_int
+    \@@_image_getbb_aux:nN {#1} \xetex_picfile:D
+  }
 \cs_new_eq:NN \@@_image_getbb_png:n \@@_image_getbb_jpg:n
 \cs_new_protected:Npn \@@_image_getbb_pdf:n #1
   { \@@_image_getbb_aux:nN {#1} \xetex_pdffile:D }
 \cs_new_protected:Npn \@@_image_getbb_auxi:nN #1#2
   {
-    \dim_if_exist:cTF { c__image_ #1 _urx_dim }
+    \int_compare:nNnTF \l__image_page_int > 0
+      { \@@_image_getbb_auxii:VnN \l__image_page_int {#1} #2  }
+      { \@@_image_getbb_auxiii:nNnn {#1} #2 }
+  }
+\cs_new_protected:Npn \@@_image_getbb_auxii:nnN #1#2#3
+  { \@@_image_getbb_aux:nNnn {#2} #3 { :P #1 } { page #1 } }
+\cs_generate_variant:Nn \@@_image_getbb_auxii:nnN { V }
+\cs_new_protected:Npn \@@_image_getbb_auxiiii:nNnn #1#2#3#4
+  {
+    \dim_if_exist:cTF { c__image_ #1#3 _urx_dim }
       {
-        \dim_set_eq:Nc \l__image_urx_dim { c__image_ #1 _urx__dim }
-        \dim_set_eq:Nc \l__image_ury_dim { c__image_ #1 _ury__dim }
+        \dim_set_eq:Nc \l__image_urx_dim { c__image_ #1#3 _urx__dim }
+        \dim_set_eq:Nc \l__image_ury_dim { c__image_ #1#3 _ury__dim }
       }
-      { \@@_image_getbb_auxii:nN {#1} #2 }
+      { \@@_image_getbb_auxiv:nNnn {#1} #2 {#3} {#4}  }
   }
-\cs_new_protected:Npn \@@_image_getbb_auxii:nN #1#2
+\cs_new_protected:Npn \@@_image_getbb_auxiv:nNnn #1#2#3#4
   {
-    \hbox_set:Nn \l__image_tmp_box { #2 #1 ~ }
+    \hbox_set:Nn \l__image_tmp_box { #2 #1 ~ #4 }
     \dim_set:Nn \l__image_urx_dim { \box_wd:N \l__image_tmp_box }
     \dim_set:Nn \l__image_ury_dim { \box_ht:N \l__image_tmp_box }
-    \dim_const:cn { c__image_ #1 _urx__dim }
+    \dim_const:cn { c__image_ #1#3 _urx__dim }
       { \l__image_urx_dim }
-    \dim_const:cn { c__image_ #1 _ury__dim }
+    \dim_const:cn { c__image_ #1#3 _ury__dim }
       { \l__image_ury_dim }
   }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
+% \end{macro}
+% \end{macro}
 %
 %    \begin{macrocode}
 %</xdvipdfmx>
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index f33615a..06f468e 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -5060,10 +5060,12 @@ Defining \l__driver_color_stack_int on line ...
 \l__driver_color_stack_int=\count147
 Defining \__driver_color_ensure_current: on line ...
 Defining \__driver_color_reset: on line ...
+Defining \l__driver_image_attr_tl on line ...
 Defining \__driver_image_getbb_jpg:n on line ...
-Defining \__driver_image_getbb_jpg_aux:n on line ...
-Defining \__driver_image_getbb_pdf:n on line ...
 Defining \__driver_image_getbb_png:n on line ...
+Defining \__driver_image_getbb_pdf:n on line ...
+Defining \__driver_image_getbb_auxi:n on line ...
+Defining \__driver_image_getbb_auxii:n on line ...
 Defining \__driver_image_include_jpg:n on line ...
 Defining \__driver_image_include_pdf:n on line ...
 Defining \__driver_image_include_png:n on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index 7f0d7d3..64d0d3d 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -5249,10 +5249,12 @@ Defining \l__driver_color_stack_int on line ...
 \l__driver_color_stack_int=\count147
 Defining \__driver_color_ensure_current: on line ...
 Defining \__driver_color_reset: on line ...
+Defining \l__driver_image_attr_tl on line ...
 Defining \__driver_image_getbb_jpg:n on line ...
-Defining \__driver_image_getbb_jpg_aux:n on line ...
-Defining \__driver_image_getbb_pdf:n on line ...
 Defining \__driver_image_getbb_png:n on line ...
+Defining \__driver_image_getbb_pdf:n on line ...
+Defining \__driver_image_getbb_auxi:n on line ...
+Defining \__driver_image_getbb_auxii:n on line ...
 Defining \__driver_image_include_jpg:n on line ...
 Defining \__driver_image_include_pdf:n on line ...
 Defining \__driver_image_include_png:n on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index b6d72c5..e6c3103 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -5038,7 +5038,10 @@ Defining \__driver_image_getbb_jpg:n on line ...
 Defining \__driver_image_getbb_png:n on line ...
 Defining \__driver_image_getbb_pdf:n on line ...
 Defining \__driver_image_getbb_auxi:nN on line ...
-Defining \__driver_image_getbb_auxii:nN on line ...
+Defining \__driver_image_getbb_auxii:nnN on line ...
+Defining \__driver_image_getbb_auxii:VnN on line ...
+Defining \__driver_image_getbb_auxiiii:nNnn on line ...
+Defining \__driver_image_getbb_auxiv:nNnn on line ...
 Defining \__driver_draw_literal:n on line ...
 Defining \__driver_draw_literal:x on line ...
 Defining \__driver_draw_begin: on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index 6d4dc9e..bdf2167 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -5061,10 +5061,12 @@ Defining \l__driver_color_stack_int on line ...
 \l__driver_color_stack_int=\count147
 Defining \__driver_color_ensure_current: on line ...
 Defining \__driver_color_reset: on line ...
+Defining \l__driver_image_attr_tl on line ...
 Defining \__driver_image_getbb_jpg:n on line ...
-Defining \__driver_image_getbb_jpg_aux:n on line ...
-Defining \__driver_image_getbb_pdf:n on line ...
 Defining \__driver_image_getbb_png:n on line ...
+Defining \__driver_image_getbb_pdf:n on line ...
+Defining \__driver_image_getbb_auxi:n on line ...
+Defining \__driver_image_getbb_auxii:n on line ...
 Defining \__driver_image_include_jpg:n on line ...
 Defining \__driver_image_include_pdf:n on line ...
 Defining \__driver_image_include_png:n on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index fc59d02..0a2da35 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -5250,10 +5250,12 @@ Defining \l__driver_color_stack_int on line ...
 \l__driver_color_stack_int=\count147
 Defining \__driver_color_ensure_current: on line ...
 Defining \__driver_color_reset: on line ...
+Defining \l__driver_image_attr_tl on line ...
 Defining \__driver_image_getbb_jpg:n on line ...
-Defining \__driver_image_getbb_jpg_aux:n on line ...
-Defining \__driver_image_getbb_pdf:n on line ...
 Defining \__driver_image_getbb_png:n on line ...
+Defining \__driver_image_getbb_pdf:n on line ...
+Defining \__driver_image_getbb_auxi:n on line ...
+Defining \__driver_image_getbb_auxii:n on line ...
 Defining \__driver_image_include_jpg:n on line ...
 Defining \__driver_image_include_pdf:n on line ...
 Defining \__driver_image_include_png:n on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index 67f5ac2..84a0cf5 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -5039,7 +5039,10 @@ Defining \__driver_image_getbb_jpg:n on line ...
 Defining \__driver_image_getbb_png:n on line ...
 Defining \__driver_image_getbb_pdf:n on line ...
 Defining \__driver_image_getbb_auxi:nN on line ...
-Defining \__driver_image_getbb_auxii:nN on line ...
+Defining \__driver_image_getbb_auxii:nnN on line ...
+Defining \__driver_image_getbb_auxii:VnN on line ...
+Defining \__driver_image_getbb_auxiiii:nNnn on line ...
+Defining \__driver_image_getbb_auxiv:nNnn on line ...
 Defining \__driver_draw_literal:n on line ...
 Defining \__driver_draw_literal:x on line ...
 Defining \__driver_draw_begin: on line ...
diff --git a/l3trial/l3image/l3image.dtx b/l3trial/l3image/l3image.dtx
index 967a5fe..2cf7f59 100644
--- a/l3trial/l3image/l3image.dtx
+++ b/l3trial/l3image/l3image.dtx
@@ -59,6 +59,11 @@
 % which in themselves contain no driver-specific code. This functionality
 % is made available here.
 %
+% \begin{variable}[int]{\l__image_page_int}
+%   The page to extract from a multi-page image file: used for |.pdf| files
+%   which may contain multiple pages.
+% \end{variable}
+%
 % \begin{variable}[int]
 %   {
 %     \l__image_llx_dim, \l__image_lly_dim ,
@@ -88,6 +93,9 @@
 %   using this function has made such a check. File types such as |.pdf| and
 %   |.jpg| are appropriate for parsing using this function.
 %
+%   When \cs{l__image_page_int} is positive the appropriate page will be
+%   queried from the image file.
+%
 %   Note that this function requires pipe shell calls to be enabled: this is
 %   generally true but may require the option |--enable-pipes| to be enabled
 %   when running the \TeX{} job.
@@ -110,7 +118,8 @@
 %   of the bounding box expressed in PostScript (\enquote{big}) points. The
 %   four values are used to set the dimensions \cs{l__image_llx_dim},
 %   \emph{etc.} The data format searched for depends on the option |hiresbb|.
-%   The boolean \cs{l__image_bb_found_bool} is set |true| on successful determination of a bounding box. In the
+%   The boolean \cs{l__image_bb_found_bool} is set |true| on successful
+%   determination of a bounding box. In the
 %   case where no data is obtained, this variable is |false| and the
 %   four dimensions are set to place holders: |llx|/|lly| to $0\,\mathrm{bp}$
 %   and |urx|/|ury| to $72\,\mathrm{bp}$.
@@ -151,6 +160,18 @@
 %    \end{macrocode}
 % \end{variable}
 %
+% \subsection{Image feature support}
+%
+% \begin{macro}[int]{\l__image_page_int}
+%   Keys which control features of images.
+%    \begin{macrocode}
+\keys_define:nn { image }
+  {
+    page .int_set:N = \l__image_page_int
+  }
+%    \end{macrocode}
+% \end{macro}
+%
 % \subsection{Obtaining bounding box data}
 %
 % \begin{variable}[int]
@@ -168,7 +189,9 @@
 % \end{variable}
 %
 % \begin{macro}[int]{\__image_extract_bb:n, \__image_read_bb:n}
-% \begin{macro}[aux]{\@@_read_bb_auxi:nnn, \@@_read_bb_auxii:nnn}
+% \begin{macro}[aux]{\__image_extract_bb_aux:nn, \__image_extract_bb_aux:nV}
+% \begin{macro}[aux]{\__image_extract_bb_aux:nnn}
+% \begin{macro}[aux]{\@@_read_bb_auxi:nnnn, \@@_read_bb_auxii:nnnn}
 % \begin{macro}[aux]
 %   {
 %     \@@_read_bb_auxii:w  ,
@@ -185,13 +208,21 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \__image_extract_bb:n #1
   {
-    \@@_read_bb_auxi:nnn {#1}
-      { \tex_openin:D \l_@@_tmp_ior = "|extractbb~-O~#1" }
+    \int_compare:nNnTF \l__image_page_int > 0
+      { \__image_extract_bb_aux:nV \l__image_page_int }
+      { \__image_extract_bb_aux:nnn {#1} { } { } }
+\cs_new_protected:Npn \__image_extract_bb_aux:nn #1#2
+  { \__image_extract_bb_aux:nnn {#1} { :P #2 } { -p~#2~ } }
+\cs_generate_variant:Nn \__image_extract_bb_aux:nn { nV }
+\cs_new_protected:Npn \__image_extract_bb_aux:nnn #1#2#3
+  {
+    \@@_read_bb_auxi:nnnn {#1} {#2}
+      { \tex_openin:D \l_@@_tmp_ior = "|extractbb~#3-O~#1" }
       { pipe-failed }
   }
 \cs_new_protected:Npn \__image_read_bb:n #1
   {
-    \@@_read_bb_auxi:nnn {#1}
+    \@@_read_bb_auxi:nnn {#1} { }
       { \ior_open:Nn \l_@@_tmp_ior {#1} }
       { image-not-found }
   }
@@ -201,26 +232,25 @@
 %  store the bounding box data in \TeX{}: this avoids multiple file operations.
 %  As bounding boxes here start away from the lower-left origin, we need to
 %  store all four values (contrast with for example the \texttt{pdfmode}
-%  driver).
+%  driver). Here |#2| is a potential page identifier: used to allow caching of
+%  individual pages in a multi-page document.
 %   \begin{macrocode}
-\cs_new_protected:Npx \@@_read_bb_auxi:nnn #1#2#3
+\cs_new_protected:Npx \@@_read_bb_auxi:nnnn #1#2#3#4
   {
-    \dim_if_exist:cTF { c_@@_ #1 _llx_dim }
+    \dim_if_exist:cTF { c_@@_ #1#2 _llx_dim }
       {
-        \dim_set_eq:Nc \l__image_llx_dim { c_@@_ #1 _llx_dim }
-        \dim_set_eq:Nc \l__image_lly_dim { c_@@_ #1 _lly_dim }
-        \dim_set_eq:Nc \l__image_urx_dim { c_@@_ #1 _urx_dim }
-        \dim_set_eq:Nc \l__image_ury_dim { c_@@_ #1 _ury_dim }
+        \dim_set_eq:Nc \l__image_llx_dim { c_@@_ #1#2 _llx_dim }
+        \dim_set_eq:Nc \l__image_lly_dim { c_@@_ #1#2 _lly_dim }
+        \dim_set_eq:Nc \l__image_urx_dim { c_@@_ #1#2 _urx_dim }
+        \dim_set_eq:Nc \l__image_ury_dim { c_@@_ #1#2 _ury_dim }
       }
-      { \@@_read_bb_auxii:nnn {#2} {#3} {#1} }
+      { \@@_read_bb_auxii:nnn {#3} {#4} {#1} {#2} }
   }
-\cs_new_protected:Npx \@@_read_bb_auxii:nnn #1#2#3
+\cs_new_protected:Npx \@@_read_bb_auxii:nnnn #1#2#3#4
   {
-    #2
+    #3
     \exp_not:N \ior_if_eof:NTF \exp_not:N \l_@@_tmp_ior
-      {
-        \__msg_kernel_error:nnn { kernel } {#3} {#1}
-      }
+      { \__msg_kernel_error:nnn { kernel } {#2} {#3} }
       {
         \ior_str_map_inline:Nn \exp_not:N \l_@@_tmp_ior
           {
@@ -229,10 +259,10 @@
           }
       }
     \ior_close:N \exp_not:N \l_@@_tmp_ior
-    \dim_const:cn { c_@@_ #1 _llx_dim } { \l__image_llx_dim }
-    \dim_const:cn { c_@@_ #1 _lly_dim } { \l__image_lly_dim }
-    \dim_const:cn { c_@@_ #1 _urx_dim } { \l__image_urx_dim }
-    \dim_const:cn { c_@@_ #1 _ury_dim } { \l__image_ury_dim }
+    \dim_const:cn { c_@@_ #3#4 _llx_dim } { \l__image_llx_dim }
+    \dim_const:cn { c_@@_ #3#4 _lly_dim } { \l__image_lly_dim }
+    \dim_const:cn { c_@@_ #3#4 _urx_dim } { \l__image_urx_dim }
+    \dim_const:cn { c_@@_ #3#4 _ury_dim } { \l__image_ury_dim }
   }
 \use:x
   {
@@ -282,6 +312,8 @@
 % \end{macro}
 % \end{macro}
 % \end{macro}
+% \end{macro}
+% \end{macro}
 %
 % \subsection{Messages}
 %

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the latex3-commits mailing list