[tex-live] bug in thumbpdf?

Norbert Preining preining at logic.at
Sun Jul 13 10:02:12 CEST 2014


Hi everyone,

I have already contacted Heiko for that, but for now without
success (holidays?), so I ask here.

(Originally Debian bug report, please keep at least the bug Cc,
same happens on up-to-date TL 2014)

It seems that thumbpdf cannot parse pdfs generated nowadays
with pdflatex:

$ cat thu.tex
\pdfobjcompresslevel=0
\documentclass[12pt]{article}
\usepackage{thumbpdf}
\begin{document}
Hello world!
\end{document}
$ pdflatex thu
This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./thu.tex
LaTeX2e <2014/05/01>
Babel <3.9k> and hyphenation patterns for 79 languages loaded.
(/home/norbert/tl/2014/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/home/norbert/tl/2014/texmf-dist/tex/latex/base/size12.clo))
(/home/norbert/tl/2014/texmf-dist/tex/generic/thumbpdf/thumbpdf.sty

Package thumbpdf Warning: Thumbnail data file `thu.tpt' not found.

) (./thu.aux) [1{/home/norbert/tl/2014/texmf-var/fonts/map/pdftex/updmap/pdftex
.map}] (./thu.aux) )</home/norbert/tl/2014/texmf-dist/fonts/type1/public/amsfon
ts/cm/cmr12.pfb>
Output written on thu.pdf (1 page, 10448 bytes).
Transcript written on thu.log.
$ thumbpdf thu.pdf
THUMBPDF 3.15, 2012/04/18 - Copyright (c) 1999-2012 by Heiko Oberdiek.
* OSNAME: linux
* PERL_VERSION: 5.018002
* ARGV: --debug thu.pdf
*** make png files / run Ghostscript ***
* Ghostscript with page numbers
Processing pages 1 through 1.
[1]
* max. page: 1
*** make `thumbpdf.pdf' / run pdfTeX ***
libpng warning: iCCP: profile 'default_rgb.icc': 0h: PCS illuminant is not D50
libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
*** parse `thumbpdf.pdf' ***
* pdf header: %PDF-1.4
* obj 4
* obj 3
* obj 1
* obj 2
* obj 6
* obj 7
* obj 5
* obj 8
* obj 9
* 9 objects found.
* ListThumbs: 1
* Size: 75x106
* Length (direct): 76
Use of uninitialized value in numeric lt (<) at
/home/norbert/tl/2014/bin/x86_64-linux/thumbpdf line 1074.
*** write `thu.tpt' (pdfTeX thumbnail data) ***
Use of uninitialized value $_[0] in split at
/home/norbert/tl/2014/bin/x86_64-linux/thumbpdf line 1476.
*** clear temp files ***
*** ready. ***
$ pdflatex thu
...
Runaway text?
<</Width 75/Height 106/BitsPerComponent 8/ColorSpace/DeviceRGB/Length\ETC.
! File ended while scanning text of \pdfobj.
<inserted text> 
                }
l.625     \input{\THB at datafile}
                               %
? 



I looked into the code and the generated thu.pdf. Thu.pdf looks like this:
%PDF-1.5
<binary rubbish>
3 0 obj
<<
/Length 96
/Filter /FlateDecode
>>
stream
<binary rubbish>
endstream
endobj
2 0 obj
...

Reading through the code of thumbpdf.pl, I see that the problem is
that no objstream is detected:
	$#objstream == -1
so that code line above which is:
	if ($thumblength[$count] < length($objstream[$i])) {
since there is no objstream defined at all ....

Checking the code of initializing the array, I see:
  while (<PDF>)
    ..
    /^(\d+)\s+0\s+obj\s*(<<)?$/ or
      die "$Error `obj' expected on line $lineno!\n";
    $objno[$count] = $1;
    $getobjindex[$1] = $count;
    $objdict[$count] = ($2); # boolean (if $2 exists)
    .....
    if ($objdict[$count])
      ....
      /^stream$/ or die "$Error `stream' expected on line $lineno!\n";
      ....
      $objstream[$count] = "";

So it seems that the $objstream is *only* initialized when the objdict[$count]
is true, i.e., if the obj line looks like
	3 0 obj <<
But the << is on the next line, and even then, moving it up, did not change
anything.

Has anyone had success with thumbpdf recently?

Can anyone reproduce this problem?

Thanks

Norbert

------------------------------------------------------------------------
PREINING, Norbert                               http://www.preining.info
JAIST, Japan                                 TeX Live & Debian Developer
GPG: 0x860CDC13   fp: F7D8 A928 26E3 16A1 9FA0  ACF0 6CAC A448 860C DC13
------------------------------------------------------------------------



More information about the tex-live mailing list