Bug 6984 - pdfimages: not working
Summary: pdfimages: not working
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other Linux (All)
: high normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2006-05-20 19:32 UTC by Rainer Keller
Modified: 2006-05-22 12:59 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
patch for bug 6984 (1.16 KB, patch)
2006-05-20 19:34 UTC, Rainer Keller
Details | Splinter Review

Description Rainer Keller 2006-05-20 19:32:35 UTC
1. The command line tool "pdfimages" is not working at all. No images will be 
written to disk because the ImageOutputDev is designated as non graphic device.

2. The ppm creation is not correct and results into rainbow colored pictures.

3. The following patch should fix this.


diff -u -r poppler-0.5.1/utils/ImageOutputDev.cc 
poppler-0.5.1patched/utils/ImageOutputDev.cc
--- poppler-0.5.1/utils/ImageOutputDev.cc 2006-01-23 16:24:36.000000000 +0100
+++ poppler-0.5.1patched/utils/ImageOutputDev.cc  2006-05-20 11:20:28.000000000 
+0200
@@ -184,9 +184,9 @@
       p = imgStr->getLine();
       for (x = 0; x < width; ++x) {
  colorMap->getRGB(p, &rgb);
- fputc((int)(rgb.r * 255 + 0.5), f);
- fputc((int)(rgb.g * 255 + 0.5), f);
- fputc((int)(rgb.b * 255 + 0.5), f);
+ fputc((int)(255.0 / 65536.0 * rgb.r), f);
+ fputc((int)(255.0 / 65536.0 * rgb.g), f);
+ fputc((int)(255.0 / 65536.0 * rgb.b), f);
  p += colorMap->getNumPixelComps();
       }       
     }
diff -u -r poppler-0.5.1/utils/ImageOutputDev.h 
poppler-0.5.1patched/utils/ImageOutputDev.h
--- poppler-0.5.1/utils/ImageOutputDev.h  2005-12-12 19:57:13.000000000 +0100
+++ poppler-0.5.1patched/utils/ImageOutputDev.h 2006-05-20 11:20:34.000000000 
+0200
@@ -45,7 +45,7 @@
   virtual GBool interpretType3Chars() { return gFalse; }
 
   // Does this device need non-text content?
-  virtual GBool needNonText() { return gFalse; }
+  virtual GBool needNonText() { return gTrue; }
 
   //---- get info about output device
Comment 1 Rainer Keller 2006-05-20 19:34:12 UTC
Created attachment 5697 [details] [review]
patch for bug 6984
Comment 2 Kristian Høgsberg 2006-05-23 05:59:11 UTC
Thanks committed, though I changed the rgb to byte conversion to use colToByte()
instead.


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.