poppler/GfxState.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
New commits: commit c54f6aceed983a221d88ce5c21becbf8aab2931b Author: Thomas Freitag <[email protected]> Date: Mon Sep 29 21:42:46 2014 +0200 use alt colorspace to get CMYK values for an ICC based CMYK colorspace The reason for the pale image is that GfxICCBasedColorSpace::getCMYK() uses the cms transformation to get RGB values and the convert it back to CMYK even for a ICC based CMYK colorspace instead of just returning the CMYK values itself. Bug #79019 diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc index eb11777..eae85dc 100644 --- a/poppler/GfxState.cc +++ b/poppler/GfxState.cc @@ -18,7 +18,7 @@ // Copyright (C) 2006, 2010 Carlos Garcia Campos <[email protected]> // Copyright (C) 2006-2014 Albert Astals Cid <[email protected]> // Copyright (C) 2009, 2012 Koji Otani <[email protected]> -// Copyright (C) 2009, 2011-2013 Thomas Freitag <[email protected]> +// Copyright (C) 2009, 2011-2014 Thomas Freitag <[email protected]> // Copyright (C) 2009 Christian Persch <[email protected]> // Copyright (C) 2010 PaweŠWiejacha <[email protected]> // Copyright (C) 2010 Christian Feuersänger <[email protected]> @@ -2189,7 +2189,7 @@ void GfxICCBasedColorSpace::getCMYKLine(Guchar *in, Guchar *out, int length) { #ifdef USE_CMS if (lineTransform != NULL && lineTransform->getTransformPixelType() == PT_CMYK) { transform->doTransform(in,out,length); - } else if (lineTransform != NULL) { + } else if (lineTransform != NULL && nComps != 4) { GfxColorComp c, m, y, k; Guchar* tmp = (Guchar *)gmallocn(3 * length, sizeof(Guchar)); getRGBLine(in, tmp, length); @@ -2232,7 +2232,7 @@ void GfxICCBasedColorSpace::getDeviceNLine(Guchar *in, Guchar *out, int length) *out++ = 0; } gfree(tmp); - } else if (lineTransform != NULL) { + } else if (lineTransform != NULL && nComps != 4) { GfxColorComp c, m, y, k; Guchar* tmp = (Guchar *)gmallocn(3 * length, sizeof(Guchar)); getRGBLine(in, tmp, length); @@ -2302,7 +2302,7 @@ void GfxICCBasedColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) { unsigned int value = (out[0] << 24) + (out[1] << 16) + (out[2] << 8) + out[3]; cmsCache.insert(std::pair<unsigned int, unsigned int>(key, value)); } - } else { + } else if (nComps != 4 && transform != NULL && transform->getTransformPixelType() == PT_RGB) { GfxRGB rgb; GfxColorComp c, m, y, k; @@ -2321,6 +2321,8 @@ void GfxICCBasedColorSpace::getCMYK(GfxColor *color, GfxCMYK *cmyk) { cmyk->m = m - k; cmyk->y = y - k; cmyk->k = k; + } else { + alt->getCMYK(color, cmyk); } #else alt->getCMYK(color, cmyk);
_______________________________________________ poppler mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/poppler
