At 12:33 PM 1/7/2002 +0000, Bruce Horrocks wrote:
Hi
>I have a simple test file that includes a PNG graphic. Generating a PDF
>file works fine. However, when I try to produce a DVI file, ConTeXt mis-
>identifies the PNG file as EPS. I'd like to know why and what can be
>done, if anything?
>
>Here is the test file:
>
>\traceexternalfigurestrue
>\starttext
>\startfiguretext[right][fig:example]
>{none}
>{\externalfigure
> [zzz.png]
> [width=2in,height=1in]
>}
>This is a test.
>\stopfiguretext
>\stoptext
>
>In the log file, I get the following when generating the PDF file:
>
>systems : begin file 00_master at line 3
> <./zzz.png>
>figures : dimensions of ./zzz.png loaded from figurefile itself
>
>[locating ./zzz.png as png] [analyzing ./zzz.png on . as png] [found]
>[./zzz.pn
>g: t={png} m={png} l=dummy w=9472573 h=4736286 sx=73.2 sy=75.0
>ox=\scratchdimen
> oy=\scratchdimen ] (./00_master.tuo)
>floatblocks : 1 placed
>
>and, as I said, this works fine - ConTeXt has correctly identified the
>files as PNG and found the correct dimensions and scale factors.
>
>When producing a DVI file, the equivalent extract from the logfile is:
>
>systems : begin file 00_master at line 3
>figures : figure ./zzz.png has zero dimensions
>figures : dimensions of ./zzz.png loaded from figurefile itself
>
>[locating ./zzz.png as eps] [analyzing ./zzz.png on . as eps] [zero]
>[found] [.
I'm not sure if you do have an eps.
Context figure inclusion works as follows:
\externalfigure[abc][...]
in this case, context will try to locate a file and determine its
dimensions based on a built in list of suffixes, strating with the best
quality available, so vector before bitmap, lossless before lossy.
In your case, you specify a suffix explitly, so context will analyze the
graphic according to its known suffixes (also depends on the driver) but
uses the file itself as subject. So, in dvi mode it will (since dvips
supports eps) analyze the png as if it was an eps. This gives zero
dimensions, so ...
Now, if you have an eps as well as a png version, you can say
\externalfigure[zzz][width=2in,height=1in]
and in the case of pdftex, the png will be used, and in case of dvi, the
eps. Depending on the settings, when no dimensions can be determined,
texutil will be used. If you say texutil --fig, you will notice that a
*.tuf file is generated. This file will be consulted when present. (texutil
can analyze the supported formats.) This also means that you can process
files without the graphics being present (given that there is a tuf file).
So, the advice is: don't specify a suffix in case of multiple output.
[when you use pdftex, an alternative is to define a figure base]
Hans
-------------------------------------------------------------------------
Hans Hagen | PRAGMA ADE | [EMAIL PROTECTED]
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
fall-back web server:
www.pragma-pod.nl
-------------------------------------------------------------------------