"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.

This entry was written by Stanislav , posted on Wednesday September 28 2022 , filed under Cold Air, Gentoo, Mathematics, NonLoper, SoftwareArchaeology, SoftwareSucks, TeX . Bookmark the permalink . Post a comment below or leave a trackback: Trackback URL.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre lang="" line="" escaped="" highlight="">


MANDATORY: Please prove that you are human:

100 xor 18 = ?

What is the serial baud rate of the FG device ?


Answer the riddle correctly before clicking "Submit", or comment will NOT appear! Not in moderation queue, NOWHERE!