[poppler] Branch 'xpdf303merge' - poppler/Gfx.cc

Carlos Garcia Campos carlosgc at kemper.freedesktop.org
Sun Sep 18 05:08:04 PDT 2011


 poppler/Gfx.cc |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 528d5b0d40302b3fee3aec69b85bdd1daa4db568
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date:   Sun Sep 18 14:03:36 2011 +0200

    xpdf303: Image XObjects can have a OC entry too

diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc
index e931925..72256d4 100644
--- a/poppler/Gfx.cc
+++ b/poppler/Gfx.cc
@@ -4055,6 +4055,16 @@ void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) {
   // get stream dict
   dict = str->getDict();
 
+  // check for optional content key
+  if (ref) {
+    dict->lookupNF("OC", &obj1);
+    if (catalog->getOptContentConfig() && !catalog->getOptContentConfig()->optContentIsVisible(&obj1)) {
+      obj1.free();
+      return;
+    }
+    obj1.free();
+  }
+
   // get size
   dict->lookup("Width", &obj1);
   if (obj1.isNull()) {
@@ -4461,7 +4471,6 @@ void Gfx::doForm(Object *str) {
   // check for optional content key
   dict->lookupNF("OC", &obj1);
   if (catalog->getOptContentConfig() && !catalog->getOptContentConfig()->optContentIsVisible(&obj1)) {
-    obj2.free();
     obj1.free();
     return;
   }


More information about the poppler mailing list