[tex-live] texlive under ubuntu cannot find proper .bb file for png image file

Heiko Oberdiek oberdiek at uni-freiburg.de
Sat Aug 1 20:39:12 CEST 2009


On Sat, Aug 01, 2009 at 01:59:50PM -0300, George N. White III wrote:

> First, thanks for providing a good report with the minimal example.
> 
> For the record, "texdoc graphics" gives the documentation
> for \includegraphics, which gives the information about how to
> use .bb files and external commands to change formats.
> 
> Note that running commands from a tex document requires that
> (restricted) \write18 be enabled.  This may not always be acceptable
> due to the potential for some malicious .tex document running a nasty
> command.
> 
> It is not so easy to determine which formats beyond EPS are
> supported directly by dvips.  The sources for dvipsk include emspecial.c,
> which says:
> 
> /* em:graph routines */
> 
> /* The graphics routines currently decode 3 types of IBM-PC based graphics   */
> /* files: .pcx, .bmp, .msp. The information on the formats has occasionally  */
> /* been sketchy, and subject to interpretation. I have attempted to implement*/
> /* these routines to correctly decode the graphics file types mentioned.     */
> /* The compressed .bmp file type has not been tested fully due to a lack of  */
> /* test files.                                                               */
> 
> With TeX Live latex+dvips you can use:
> 
> \documentclass{article}
> \usepackage{graphicx}
> \DeclareGraphicsExtensions{.bmp}
> \DeclareGraphicsRule{.bmp}{bmp}{.bb}{}%      BMP
> \begin{document}
> \begin{figure}
>  \includegraphics{golfer.bmp}
> \end{figure}
> 
> \end{document}

Happily latex is based on pdfTeX nowadays, thus we have \pdffiledump
and based on this primitive package `bmpsize' was written.
The package determines the size without the need of .bb files.
Also the package fixes other problems of dvips.def by adding
support for `viewport', `trim' and `clip' for bitmap graphics.

\documentclass{article}
\usepackage[dvips]{graphicx}
\usepackage{bmpsize}
\begin{document}
\includegraphics{golfer.bmp}
\end{document}

Yours sincerely
  Heiko <oberdiek at uni-freiburg.de>


More information about the tex-live mailing list