[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#753239: [tex-live] bug in thumbpdf? - PATCH



On Tue, 15 Jul 2014, Norbert Preining wrote:
> Patch attached, comments welcome.

Simplified patch.

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
------------------------------------------------------------------------
--- thumbpdf.pl.orig	2014-07-13 16:24:53.823731368 +0900
+++ thumbpdf.pl	2014-07-15 01:28:11.038948054 +0900
@@ -937,6 +937,18 @@
     $objno[$count] = $1;
     $getobjindex[$1] = $count;
     $objdict[$count] = ($2); # boolean (if $2 exists)
+    if (!$objdict[$count]) {
+      # check for << on thext line
+      my $pos = tell();
+      $_ = <PDF>;
+      if (/^<<$/) {
+      	$objdict[$count] = 1;
+	$lineno++;
+      } else {
+        # undo the reading
+	seek PDF, $pos, 0;
+      }
+    }
     my $stream = 0;
     print "* obj $objno[$count]" .
       (($objdict[$count]) ? " (dict)" : "") .
@@ -954,8 +966,10 @@
         {
           last if /^>>\s+endobj$/; # obj without stream
 
-          # get stream
           $_ = <PDF>; $lineno++;
+          last if /^endobj$/; # obj without stream, new PDF-X/2014
+
+          # get stream
           /^stream$/ or die "$Error `stream' expected on line $lineno!\n";
 
           print "* stream\n" if $::opt_debug;

Reply to: