[l2h] Empty figures by pstoimg

Julius Smith jos at ccrma.stanford.edu
Sat Mar 14 00:13:00 CET 2009


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
very recently (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.

-- 
"Anybody who knows all about nothing knows everything" -- Leonard Susskind


More information about the latex2html mailing list