latex3 / graphics-def

driver option files for color and graphics
LaTeX Project Public License v1.3c
10 stars 7 forks source link

graphics.sty: \Gread@attr@hash has no effect #9

Closed aminophen closed 7 years ago

aminophen commented 7 years ago

Current graphics.sty has the following definition \Gread@generic@aux:

\def\Gread@generic@aux#1#2{%
  \begingroup
  \@tempcnta\z@
  \loop\ifnum\@tempcnta<\@xxxii
     \catcode\@tempcnta14 %
     \advance\@tempcnta\@ne
  \repeat
  \catcode`\^^?14 %
  \let\do\@makeother
  \dospecials
  \catcode`\ 10 %
  \catcode`\^^I10 %
  \catcode\endlinechar5 %
  \@makeother\:%
  \@makeother\-%
  \immediate\openin\@inputcheck"#1" %
  #2{#1}%
  \ifGin@bbox\else
    \@latex@error
      {Cannot determine size of graphic in #1 (no BoundingBox)}%
      \@ehc
    \gdef\@gtempa{0 0 72 72 }%
  \fi
  \endgroup
}

However, when the definition of \Gread@generic is taken into account, it should be

\def\Gread@generic@aux#1#2{%
  \begingroup
  \@tempcnta\z@
  \loop\ifnum\@tempcnta<\@xxxii
     \catcode\@tempcnta14 %
     \advance\@tempcnta\@ne
  \repeat
  \catcode`\^^?14 %
  \let\do\@makeother
  \dospecials
  \catcode`\ 10 %
  \catcode`\^^I10 %
  \catcode\endlinechar5 %
  \@makeother\:%
  \@makeother\-%
  \immediate\openin\@inputcheck"#1" %
  #2{#1}%
  \ifGin@bbox
    \expandafter\xdef\csname #1 bbox\Gread@attr@hash\endcsname{\@gtempa}%
  \else
    \@latex@error
      {Cannot determine size of graphic in #1 (no BoundingBox)}%
      \@ehc
    \gdef\@gtempa{0 0 72 72 }%
  \fi
  \endgroup
}

By applying this change, the following code works very fast:

\documentclass{article}
\usepackage[dvipdfmx]{graphicx}
\begin{document}
\newcount\NUMBER
\loop\ifnum\NUMBER<100\relax
  \includegraphics[scale=0.3]{test0.pdf}\newpage
  \advance\NUMBER 1\relax
\repeat
\end{document}
josephwright commented 7 years ago

Oops: forgot about that (having put in the mechanism). I'll update later today (will wait and see what else is wrong first).

josephwright commented 7 years ago

Fixed in the SVN.

aminophen commented 7 years ago

Checked r1501; Thanks!