\ProvidesFile{graphics.cfg}%
  [2005/02/03 v1.3 graphics configuration of teTeX/TeXLive]

% Select an appropriate default driver
\begingroup
  \chardef\x=0\relax
  % check pdfTeX
  \@ifundefined{pdfoutput}{}{%
    \ifcase\pdfoutput
    \else
      \chardef\x=1\relax
    \fi
  }%
  % check VTeX
  \@ifundefined{OpMode}{}{%
    \chardef\x=2\relax
  }%
\expandafter\endgroup
\ifcase\x
  % default case
  \def\Gin@driver{dvips.def}%
  \ExecuteOptions{dvips}%
\or
  % pdfTeX is running in pdf mode
  \def\Gin@driver{pdftex.def}%
  \ExecuteOptions{pdftex}%
\else
  % VTeX is running
  \def\Gin@driver{vtex.def}%
  \ExecuteOptions{vtex}%
\fi

% Fix for dvips and xdvi versions that can uncompress
% graphic files without an explicite call of gunzip.
% (The fix is not applied for miniltx.tex, because
% \AtEndOfPackage is not available in plainTeX.)
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname AtEndOfPackage\endcsname\relax
\else
  \AtEndOfPackage{%
    \begingroup
    \@ifundefined{DeclareGraphicsRule}{%
      \endgroup
    }{%
      \def\x{dvips.def}%
      \expandafter\endgroup
      \ifx\x\Gin@driver
        \DeclareGraphicsRule{.pz}{eps}{.bb}{}%
        \DeclareGraphicsRule{.eps.Z}{eps}{.eps.bb}{}%
        \DeclareGraphicsRule{.ps.Z}{eps}{.ps.bb}{}%
        \DeclareGraphicsRule{.ps.gz}{eps}{.ps.bb}{}%
        \DeclareGraphicsRule{.eps.gz}{eps}{.eps.bb}{}%
      \fi
    }%
  }%
\fi
\endinput
