Bug 12208 - Poppler doesn't handle some 1-bit images well
Summary: Poppler doesn't handle some 1-bit images well
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-29 02:13 UTC by Darren Kenny
Modified: 2007-09-02 10:03 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Darren Kenny 2007-08-29 02:13:04 UTC
The attached PDF file doesn't render correctly due to an error in the 1-bit images, which produces the following error:

Error: Bad Indexed color space (lookup table stream too short)
Error (87541): Bad image parameters

While this is probably a correct assertion, other renderers like Adobe Reader and GhostScript, while reporting the error, correct it by padding the image with 0s - e.g. GS gives the following error:

   **** Warning: Short look-up table in the Indexed color space was padded with 0's.

This results in a more usable image than the existing behaviour.
Comment 1 Darren Kenny 2007-08-29 02:58:07 UTC
Since I don't seem to be able to attach the file, I've uploaded it to:

http://blogs.sun.com/dar/resource/Chichester_2008__Order_of_service.pdf
Comment 2 Darren Kenny 2007-08-29 07:52:28 UTC
At it's simplest this can be fixed with the following change:

diff -u ./poppler/GfxState.cc~ ./poppler/GfxState.cc
--- ./poppler/GfxState.cc~      Fri Apr  6 12:11:48 2007
+++ ./poppler/GfxState.cc       Wed Aug 29 15:46:51 2007
@@ -1119,7 +1119,8 @@
       for (j = 0; j < n; ++j) {
        if ((x = obj1.streamGetChar()) == EOF) {
          error(-1, "Bad Indexed color space (lookup table stream too short)");
-         goto err3;
+         //goto err3;
+      x = 0;
        }
        cs->lookup[i*n + j] = (Guchar)x;
       }

While I know this isn't perfect, it does render the images correctly, while still reporting the errors.
Comment 3 Albert Astals Cid 2007-09-02 10:03:08 UTC
patch in, thanks


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.