<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - pdfimages failed to list/extract image"
href="https://bugs.freedesktop.org/show_bug.cgi?id=91734#c4">Comment # 4</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - pdfimages failed to list/extract image"
href="https://bugs.freedesktop.org/show_bug.cgi?id=91734">bug 91734</a>
from <span class="vcard"><a class="email" href="mailto:a246246_246-kde@yahoo.co.jp" title="a246246_246-kde@yahoo.co.jp">a246246_246-kde@yahoo.co.jp</a>
</span></b>
<pre>Quick fix for my case:
---cut here---
diff --git a/utils/ImageOutputDev.cc b/utils/ImageOutputDev.cc
index 5de51ad..cd8898c 100644
--- a/utils/ImageOutputDev.cc
+++ b/utils/ImageOutputDev.cc
@@ -46,6 +46,7 @@
#include "goo/PNGWriter.h"
#include "goo/TiffWriter.h"
#include "Error.h"
+#include "Gfx.h"
#include "GfxState.h"
#include "Object.h"
#include "Stream.h"
@@ -585,11 +586,21 @@ void ImageOutputDev::writeImage(GfxState *state, Object
*ref, Stream *str,
}
}
-GBool ImageOutputDev::tilingPatternFill(GfxState *state, Gfx *gfx, Catalog
*cat, Object *str,
+GBool ImageOutputDev::tilingPatternFill(GfxState *state, Gfx *gfxA, Catalog
*cat, Object *str,
double *pmat, int paintType, int tilingType,
Dict *resDict,
double *mat, double *bbox,
int x0, int y0, int x1, int y1,
double xStep, double yStep) {
+ // In case Do operator for Image is in Pattern, need to retrieve it.
+ if (doc) {
+ PDFRectangle box;
+ Gfx *gfx;
+ box.x1 = bbox[0]; box.y1 = bbox[1];
+ box.x2 = bbox[2]; box.y2 = bbox[3];
+ gfx = new Gfx(doc, this, resDict, &box, NULL, NULL, NULL,
gfxA->getXRef());
+ gfx->display(str);
+ delete gfx;
+ }
return gTrue;
// do nothing -- this avoids the potentially slow loop in Gfx.cc
}
diff --git a/utils/ImageOutputDev.h b/utils/ImageOutputDev.h
index a694bbc..da9e779 100644
--- a/utils/ImageOutputDev.h
+++ b/utils/ImageOutputDev.h
@@ -38,6 +38,7 @@
#include "goo/gtypes.h"
#include "goo/ImgWriter.h"
#include "OutputDev.h"
+#include "PDFDoc.h"
class GfxState;
@@ -71,6 +72,8 @@ public:
// Destructor.
virtual ~ImageOutputDev();
+ void setDoc(PDFDoc *docA) { doc = docA; }
+
// Use PNG format for output
void enablePNG(GBool png) { outputPNG = png; }
@@ -163,6 +166,7 @@ private:
char *fileRoot; // root of output file names
char *fileName; // buffer for output file names
GBool listImages; // list images instead of dumping
+ PDFDoc *doc;
GBool dumpJPEG; // set to dump native JPEG files
GBool dumpJP2; // set to dump native JPEG2000 files
GBool dumpJBIG2; // set to dump native JBIG2 files
diff --git a/utils/pdfimages.cc b/utils/pdfimages.cc
index 563839e..256158c 100644
--- a/utils/pdfimages.cc
+++ b/utils/pdfimages.cc
@@ -214,6 +214,7 @@ int main(int argc, char *argv[]) {
imgOut->enableJBig2(dumpJBIG2);
imgOut->enableCCITT(dumpCCITT);
}
+ imgOut->setDoc(doc);
doc->displayPages(imgOut, firstPage, lastPage, 72, 72, 0,
gTrue, gFalse, gFalse);
}</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>