Bug 1150208 - latex2html problems with new perl and images
latex2html problems with new perl and images
Status: RESOLVED FIXED
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Other
Current
Other Other
: P5 - None : Normal (vote)
: ---
Assigned To: Petr Gajdos
E-mail List
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-09-10 16:15 UTC by Andy May
Modified: 2019-09-30 09:00 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andy May 2019-09-10 16:15:26 UTC
When running latex2html on a project that runs fine on leap I see the following perl warning on tumbleweed:

Loading /usr/share/latex2html/styles/texdefs.perl...
Package: loading /usr/share/latex2html/styles/article.perl
Package: loading /usr/share/latex2html/styles/graphicx.perl
Package: loading /usr/share/latex2html/styles/graphics-support.perlUnescaped left brace in regex is deprecated here (and will be fatal in Perl 5.32), passed through in regex; marked by <-- HERE in m/\s*({ <-- HERE |})\s*/ at /usr/share/latex2html/styles/graphics-support.perl line 175, <STYLES> line 5.

Package: loading /usr/share/latex2html/styles/getimagesize.perl
Package: loading /usr/share/latex2html/styles/hyperref.perl
Package: loading /usr/share/latex2html/styles/html.perl
Package: loading /usr/share/latex2html/styles/verbatim.perl
Package: loading /usr/share/latex2html/styles/makeidx.perl

That can be avoided with:

sed -i -e '/paths =~/s/{/\\{/' /usr/share/latex2html/styles/graphics-support.perl

and I guess from the warning message should be done before perl 5.32 or newer becomes the default.

Later I see problems converting some images, again no such problem on leap. Setting DEBUG=1 and running I see the following:


Converting image #201
pstoimg: Temporary directory is /tmp/l2h27347
pstoimg: EPSF dimensions are 364x58
pstoimg: Running /usr/bin/gs  -sDEVICE=ppmraw -g582x93  -r115 -dTextAlphaBits=4  -sOutputFile=/tmp/l2h27347/p27433.pnm 
GS>-88 -663 translate
GS>(/tmp/l2h27347/image201.ps) run
GS>showpage
GS>quit

GPL Ghostscript 9.27 (2019-04-04)
Copyright (C) 2018 Artifex Software, Inc.  All rights reserved.
This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:
see the file COPYING for details.
GS>GS>>>showpage, press <return> to continue<<
GS>>>showpage, press <return> to continue<<
GS>Image "/tmp/l2h27347/p27433.pnm" is PPM, 582x93
Running "/usr/bin/pnmcrop -verbose  < /tmp/l2h27347/p27433.pnm | /usr/bin/pnmcrop -verbose  -bot -sides  -sides  | /usr/bin/pnmcrop -verbose  -l -sides  -sides  | /usr/bin/pnmcrop -verbose  -r -sides  -sides  | /usr/bin/pnmcrop -verbose  -l -sides  -sides  | /usr/bin/ppmquant -floyd 256 | /usr/bin/pnmtopng -interlace -trans '#ffffff'  > img201.png"
pnmcrop: You cannot specify more than one of -black, -white, -sides, -bg-color, -bg-corner
pnmcrop: You cannot specify more than one of -black, -white, -sides, -bg-color, -bg-corner
pnmcrop: Background color is #ffffff
pnmcrop: Cropping 1 pixel from the left border
pnmcrop: Cropping 4 pixels from the right border
pnmcrop: Cropping 1 pixel from the top border
pnmcrop: Cropping 1 pixel from the bottom border
pnmcrop: You cannot specify more than one of -black, -white, -sides, -bg-color, -bg-corner
pnmcrop: You cannot specify more than one of -black, -white, -sides, -bg-color, -bg-corner
pnmcolormap: making histogram...
pnmcolormap: Scanning image 0
pnmcolormap: Error reading first byte of what is expected to be a Netpbm magic number.  Most often, this means your input file is empty
pnmcolormap failed, rc=256
pnmtopng: Error reading first byte of what is expected to be a Netpbm magic number.  Most often, this means your input file is empty
pstoimg: Error: "/usr/bin/pnmcrop -verbose  < /tmp/l2h27347/p27433.pnm | /usr/bin/pnmcrop -verbose  -bot -sides  -sides  | /usr/bin/pnmcrop -verbose  -l -sides  -sides  | /usr/bin/pnmcrop -verbose  -r -sides  -sides  | /usr/bin/pnmcrop -verbose  -l -sides  -sides  | /usr/bin/ppmquant -floyd 256 | /usr/bin/pnmtopng -interlace -trans '#ffffff'  > img201.png" failed: 

Error while converting image


It is not clear to me what the problem is. For reference the output from leap where everything works fine is:

Converting image #201
pstoimg: Temporary directory is /tmp/andy/l2h363
pstoimg: EPSF dimensions are 364x58
pstoimg: Running /usr/bin/gs  -sDEVICE=ppmraw -g582x93  -r115 -dTextAlphaBits=4  -sOutputFile=/tmp/andy/l2h363/p507.pnm 
GS>-88 -663 translate
GS>(/tmp/andy/l2h363/image201.ps) run
GS>showpage
GS>quit

GPL Ghostscript 9.26 (2018-11-20)
Copyright (C) 2018 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
GS>GS>>>showpage, press <return> to continue<<
GS>>>showpage, press <return> to continue<<
GS>Image "/tmp/andy/l2h363/p507.pnm" is PPM, 582x93
Running "/usr/bin/pnmcrop -verbose  < /tmp/andy/l2h363/p507.pnm | /usr/bin/pnmcrop -verbose  -bot -sides  -sides  | /usr/bin/pnmcrop -verbose  -l -sides  -sides  | /usr/bin/pnmcrop -verbose  -r -sides  -sides  | /usr/bin/pnmcrop -verbose  -l -sides  -sides  | /usr/bin/ppmquant -floyd 256 | /usr/bin/pnmtopng -interlace -trans '#d9d9d9'  > img201.png"
pnmcrop: Background color is silver
pnmcrop: Cropping 1 pixel from the left border
pnmcrop: Cropping 4 pixels from the right border
pnmcrop: Cropping 1 pixel from the top border
pnmcrop: Cropping 1 pixel from the bottom border
pnmcrop: Background color is white
pnmcrop: The image is entirely background; there is nothing to crop.
pnmcrop: Background color is #231f20
pnmcrop: Not cropping left edge
pnmcrop: Not cropping right edge
pnmcrop: Not cropping top edge
pnmcrop: Not cropping bottom edge
pnmcrop: Background color is #231f20
pnmcrop: Cropping 3 pixels from the left border
pnmcrop: Not cropping right edge
pnmcrop: Not cropping top edge
pnmcrop: Not cropping bottom edge
pnmcrop: Background color is silver
pnmcrop: Not cropping left edge
pnmcrop: Not cropping right edge
pnmcrop: Not cropping top edge
pnmcrop: Not cropping bottom edge
pnmcrop: Background color is silver
pnmcrop: Cropping 45 pixels from the left border
pnmcrop: Not cropping right edge
pnmcrop: Not cropping top edge
pnmcrop: Not cropping bottom edge
pnmcolormap: making histogram...
pnmcolormap: Scanning image 0
pnmcolormap: 16 colors so far
pnmcolormap: 16 colors found
pnmcolormap: Image already has few enough colors (<=256).  Keeping same colors.
pnmremap: 16 colors found in colormap
Converting image #203
Comment 1 Petr Gajdos 2019-09-11 18:59:57 UTC
(In reply to Andy May from comment #0)
> sed -i -e '/paths =~/s/{/\\{/'
> /usr/share/latex2html/styles/graphics-support.perl

I think it is fixed by
https://github.com/latex2html/latex2html/commit/f4063c6719572b0f3e952eb3b5584467de6ed3da
Newest latex2html 2019.2 is on its way to factory. Feel free to test it and report when the issue persists.

But anyway .. when it would not be so, this is typical upstream report, not downstream.

> Later I see problems converting some images, again no such problem on leap.
> Setting DEBUG=1 and running I see the following:

You forgot to add test case images and commands.
Comment 2 Andy May 2019-09-12 08:53:07 UTC
(In reply to Petr Gajdos from comment #1)
> I think it is fixed by
> https://github.com/latex2html/latex2html/commit/
> f4063c6719572b0f3e952eb3b5584467de6ed3da
> Newest latex2html 2019.2 is on its way to factory. Feel free to test it and
> report when the issue persists.
> 
> But anyway .. when it would not be so, this is typical upstream report, not
> downstream.

You're of course correct, I would not even have reported that warning if I wasn't looking through the logs for the image conversion error.

> 
> You forgot to add test case images and commands.

Apologies, a simple test input of:

\documentclass{article}
\begin{document}
$some words$
\end{document}

run with:

latex2html test.tex

should reproduce the problem. On my leap system the relevant part of the output is simply:

Converting image #1

on tumbleweed system:

Converting image #1
pstoimg: Error: "/usr/bin/pnmcrop -verbose  < /tmp/l2h10634/p10646.pnm | /usr/bin/pnmcrop -verbose  -bot -sides  -sides  | /usr/bin/pnmcrop -verbose  -l -sides  -sides   > /tmp/l2h10634/p10646.t00" failed: Illegal seek

Error while converting image

Error: Cannot read 'img1.png': No such file or directory


If I compare the test/images.log files from each system I notice a change from using color.sty:

) (/usr/share/texmf/tex/latex/graphics/color.sty
Package: color 2016/07/10 v1.1e Standard LaTeX Color (DPC)

to xcolor.sty:

) (/usr/share/texmf/tex/latex/xcolor/xcolor.sty
Package: xcolor 2016/05/11 v2.12 LaTeX color extensions (UK)

maybe that's relevant?

running with DEBUG=1 on tumbleweed:

GPL Ghostscript 9.27 (2019-04-04)
Copyright (C) 2018 Artifex Software, Inc.  All rights reserved.
This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:
see the file COPYING for details.
GS>GS>>>showpage, press <return> to continue<<
GS>>>showpage, press <return> to continue<<
GS>Running "/usr/bin/pnmcrop -verbose  < /tmp/l2h43/p55.pnm | /usr/bin/pnmcrop -verbose  -bot -sides  -sides  | /usr/bin/pnmcrop -verbose  -l -sides  -sides   > /tmp/l2h43/p55.t01"
pnmcrop: Background color is #ffffff
pnmcrop: Cropping 1 pixel from the left border
pnmcrop: Cropping 1 pixel from the right border
pnmcrop: Cropping 2 pixels from the top border
pnmcrop: Cropping 1 pixel from the bottom border
pnmcrop: You cannot specify more than one of -black, -white, -sides, -bg-color, -bg-corner
pnmcrop: Background color is #ffffff
pnmcrop: The image is entirely background; there is nothing to crop.
pnmcrop: You cannot specify more than one of -black, -white, -sides, -bg-color, -bg-corner
pstoimg: Error: "/usr/bin/pnmcrop -verbose  < /tmp/l2h43/p55.pnm | /usr/bin/pnmcrop -verbose  -bot -sides  -sides  | /usr/bin/pnmcrop -verbose  -l -sides  -sides   > /tmp/l2h43/p55.t01" failed: 

Error while converting image

Error: Cannot read 'img1.png': No such file or directory


and for completeness, the same on the working leap system:

GPL Ghostscript 9.26 (2018-11-20)
Copyright (C) 2018 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
GS>GS>>>showpage, press <return> to continue<<
GS>>>showpage, press <return> to continue<<
GS>Running "/usr/bin/pnmcrop -verbose  < /tmp/l2h18002/p18015.pnm | /usr/bin/pnmcrop -verbose  -bot -sides  -sides  | /usr/bin/pnmcrop -verbose  -l -sides  -sides   > /tmp/l2h18002/p18015.t01"
pnmcrop: Background color is silver
pnmcrop: Cropping 1 pixel from the left border
pnmcrop: Cropping 1 pixel from the right border
pnmcrop: Cropping 2 pixels from the top border
pnmcrop: Cropping 1 pixel from the bottom border
pnmcrop: Background color is white
pnmcrop: The image is entirely background; there is nothing to crop.
pnmcrop: Background color is #231f20
pnmcrop: Not cropping left edge
pnmcrop: Not cropping right edge
pnmcrop: Not cropping top edge
pnmcrop: Cropping 3 pixels from the bottom border
pnmcrop: Background color is #231f20
pnmcrop: Cropping 3 pixels from the left border
pnmcrop: Not cropping right edge
pnmcrop: Not cropping top edge
pnmcrop: Not cropping bottom edge
Image "/tmp/l2h18002/p18015.pnm" is PPM, 83x15
Running "/usr/bin/pnmcrop -verbose   -sides  -bot < /tmp/l2h18002/p18015.pnm > /tmp/l2h18002/p18015.t02"
pnmcrop: Background color is silver
pnmcrop: Not cropping left edge
pnmcrop: Not cropping right edge
pnmcrop: Not cropping top edge
pnmcrop: Not cropping bottom edge
Image "/tmp/l2h18002/p18015.t02" is PPM, 83x15
Image "/tmp/l2h18002/p18015.pnm" is PPM, 83x15
Running "/usr/bin/ppmquant -floyd 256 < /tmp/l2h18002/p18015.pnm | /usr/bin/pnmtopng -interlace -trans '#d9d9d9'  > img1.png"
pnmcolormap: making histogram...
pnmcolormap: Scanning image 0
pnmcolormap: 16 colors so far
pnmcolormap: 16 colors found
pnmcolormap: Image already has few enough colors (<=256).  Keeping same colors.
pnmremap: 16 colors found in colormap
Comment 3 Andy May 2019-09-12 09:28:49 UTC
After more debugging I think it's an issue with the new netpbm that comes on tumbleweed, the following which switches to leap's netpbm allows latex2html to generate images:

zypper in latex2html # get dependencies needed for manual install of netpbm
zypper rm latex2html netpbm
wget "https://download.opensuse.org/distribution/leap/15.1/repo/oss/x86_64/netpbm-10.80.1-lp151.3.1.x86_64.rpm"
rpm -i netpbm-10.80.1-lp151.3.1.x86_64.rpm
zypper in latex2html

so it seems the issue is incompatibility between latex2html and the newer netpbm.
Comment 4 Petr Gajdos 2019-09-12 19:01:43 UTC
Yes, it looked like so already from

--------
pstoimg: Error: "/usr/bin/pnmcrop -verbose  < /tmp/l2h27347/p27433.pnm | /usr/bin/pnmcrop -verbose  -bot -sides  -sides  | /usr/bin/pnmcrop -verbose  -l -sides  -sides  | /usr/bin/pnmcrop -verbose  -r -sides  -sides  | /usr/bin/pnmcrop -verbose  -l -sides  -sides  | /usr/bin/ppmquant -floyd 256 | /usr/bin/pnmtopng -interlace -trans '#ffffff'  > img201.png" failed: 

Error while converting image
--------

log entry from comment 0. However, when I use latex2html 2019.2, I see no netpbm related error. Now I get

--------
Error: /undefinedfilename in (./images.pdf)
Operand stack:

Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push
Dictionary stack:
   --dict:723/1123(ro)(G)--   --dict:0/20(G)--   --dict:75/200(L)--
Current allocation mode is local
Last OS error: No such file or directory
GPL Ghostscript 9.27: Unrecoverable error, exit code 1
Error: 
Converting image #1
pstoimg: Error: Cannot find file "/tmp/l2h28611/image001.ps": No such file or directory

Error while converting image

Error: Cannot read 'img1.png': No such file or directory
--------

So the result seem to be same.
Comment 5 Petr Gajdos 2019-09-13 05:41:25 UTC
preview.sty was missing on the changeroot. I have added texlive-preview to Requires and now it seems it is working. Please give 2019.2 a try and report when the issue persists.

Thanks
Comment 6 Andy May 2019-09-13 12:32:28 UTC
Thanks very much. I tried directly with:

zypper in -y latex2html texlive-preview
zypper rm -y latex2html
wget "https://github.com/latex2html/latex2html/archive/v2019.2.tar.gz"
tar -xzf v2019.2.tar.gz
cd latex2html-2019.2/
./configure
make
make install

and it all worked fine with the resulting latex2html. Once the updated package is available in the repository I'll check that also.
Comment 7 Andy May 2019-09-28 13:16:50 UTC
I'm afraid the 2019.2 package in the repos is still not working out of the box for the reported case. The reason is that texlive-preview has not been added to Requires for latex2html as per comment 5, rather it has been added for BuildRequires only. The work around at present is to:

zypper in latex2html texlive-preview
Comment 8 Petr Gajdos 2019-09-30 08:26:38 UTC
Yep, thanks for letting me know. It will be fixed in next submission.
Comment 9 Swamp Workflow Management 2019-09-30 09:00:12 UTC
This is an autogenerated message for OBS integration:
This bug (1150208) was mentioned in
https://build.opensuse.org/request/show/734018 Factory / latex2html