[poppler] Branch 'poppler-0.18' - poppler/GfxState.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Mon Nov 14 04:27:55 PST 2011


 poppler/GfxState.cc |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 8bd54e8fcb3ef202fb985bca4c2c4a355594e11c
Author: Albert Astals Cid <aacid at kde.org>
Date:   Mon Nov 14 13:22:53 2011 +0100

    Make GfxColorSpace::parse accept dicts too
    (cherry picked from commit a4c78946bc1fc3d52152af2e319051050ab05e28)

diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc
index bce57cc..8c56b28 100644
--- a/poppler/GfxState.cc
+++ b/poppler/GfxState.cc
@@ -257,8 +257,20 @@ GfxColorSpace *GfxColorSpace::parse(Object *csObj, Gfx *gfx) {
       error(-1, "Bad color space");
     }
     obj1.free();
+  } else if (csObj->isDict()) {
+    csObj->dictLookup("ColorSpace", &obj1);
+    if (obj1.isName("DeviceGray")) {
+      cs = new GfxDeviceGrayColorSpace();
+    } else if (obj1.isName("DeviceRGB")) {
+      cs = new GfxDeviceRGBColorSpace();
+    } else if (obj1.isName("DeviceCMYK")) {
+      cs = new GfxDeviceCMYKColorSpace();
+    } else {
+      error(-1, "Bad color space '%s'", csObj->getName());
+    }
+    obj1.free();
   } else {
-    error(-1, "Bad color space - expected name or array");
+    error(-1, "Bad color space - expected name, array or dict");
   }
   return cs;
 }


More information about the poppler mailing list