"Hevea" Image Generator Bug Fix.
The "imagen" utility included with Hevea, a LaTeX to HTML translator, suffers from a subtle bug in combination with certain versions of of Ghostscript and ImageMagick, where the output of the former (a bitmap image) is pumped into the latter (for trimming / resizing) via a Unix pipe.
For buffer-related reasons which ultimately remain a mystery, the operation fails when Ghostscript's output exceeds a certain size (4kB or so).
A simple cure, tested with the current version of Hevea (2.36) :
diff -uNr a/hevea-2.36/imagen b/hevea-2.36/imagen --- a/hevea-2.36/imagen 2022-06-15 10:09:28.000000000 -0400 +++ b/hevea-2.36/imagen 2022-09-28 16:45:09.000000000 -0400 @@ -93,7 +93,7 @@ -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -dDOINTERPOLATE \ -P- -dSAFER" -CONVERT="convert png:- ${CROP} ${EXTRA} ${MARGIN} ${TOEXT}" +CONVERT="cat >$1 && convert $1 ${CROP} ${EXTRA} ${MARGIN} ${TOEXT}" echo ${CONVERT} > ${COM} if [ "${TODIR}" = "." ] then
Edit: and here's a slightly less-ugly patch suggested by author of Hevea.