[poppler] poppler/GfxState.cc
Albert Astals Cid
aacid at kemper.freedesktop.org
Mon Nov 14 04:26:09 PST 2011
poppler/GfxState.cc | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
New commits:
commit a4c78946bc1fc3d52152af2e319051050ab05e28
Author: Albert Astals Cid <aacid at kde.org>
Date: Mon Nov 14 13:22:53 2011 +0100
Make GfxColorSpace::parse accept dicts too
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