Next  |  Prev  |  Up  |  Top  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search

Empty Figures

Somewhere around ghostscript-8.63 (and presumably somewhat earlier), all images generated by the latex2html's pstoimg utility became empty. Some debugging revealed that the problem could be worked around by disabling the $have_geometry variable in pstoimg. This results in no translation or cropping of the image when converting from PostScript to .pnm using gs. The cropping is then done later by pnmcrop. Fixing this bug will speed up image translation. I first noticed the problem in early 2009 (on Fedora 10 and Mac OS X).

Here is the relevant diff for pstoimg:

diff -cb pstoimg-prv pstoimg
*** pstoimg-prv	Sat Dec 27 04:54:49 2008
--- pstoimg	Fri Mar 13 03:39:48 2009
***************
*** 961,967 ****
            $bbw = int($bbw + 0.99);
            $bbh = int($bbh + 0.99);
            $GEOMETRY = "${bbw}x${bbh}";
!           $have_geometry = 1;
            last;
            }
          }
--- 968,974 ----
            $bbw = int($bbw + 0.99);
            $bbh = int($bbh + 0.99);
            $GEOMETRY = "${bbw}x${bbh}";
! #jos:          $have_geometry = 1;
            last;
            }
          }
***************
*** 1001,1007 ****
      $bbw += 10;  # add a 5pt margin for safety
      $bbh += 40;  # add a 20pt margin for safety
      $GEOMETRY = "${bbw}x$bbh";
!     $have_geometry = 1;
      }
    if($have_geometry) {
      $gs_size = "-g$GEOMETRY ";
--- 1008,1014 ----
      $bbw += 10;  # add a 5pt margin for safety
      $bbh += 40;  # add a 20pt margin for safety
      $GEOMETRY = "${bbw}x$bbh";
! #jos:    $have_geometry = 1;
      }
    if($have_geometry) {
      $gs_size = "-g$GEOMETRY ";

Needless to say, this is just a workaround for the problem, and really the arguments to ghostscript should be properly debugged.


Next  |  Prev  |  Up  |  Top  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search

Download webpub.pdf
[Report a bug]

``Tools for Publishing LaTeX Documents on the Web'', by Julius O. Smith III.
Copyright © 2009-03-13 by Julius O. Smith III
Center for Computer Research in Music and Acoustics (CCRMA),   Stanford University
CCRMA  [About the Automatic Links]