Fix for 687020 and 687146
"Dan Coby" <[email protected]>
| Newsgroups | gmane.comp.printing.ghostscript.patches |
|---|---|
| Message-ID | <[email protected]> |
Fix for 687020 and 687146. The pdfwrite device is incorrectly converting
CalRGB color spaces into ICC color spaces. Fix #1.
Details:
As Raph pointed out in the Wednesday's support call, there are actually
two problems.
1. We were not correctly recognizing that we can use a CalRGB color space
for the output. This patch corrects this problem. One of the tests in
that process was assuming an incorrect ordering to the transforms. This
fix corrects this problem.
2. The ICC color space which is being created is not equivalent to the
original CalRGB color space. This results in differing colors between
the original file and the output PDF file. This problem is still open.
Note: I am leaving these bug reports still open since problem 2 is still
open.
Dan
Index: src/gdevpdfc.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/gdevpdfc.c,v
retrieving revision 1.41
diff -u -d -r1.41 gdevpdfc.c
--- src/gdevpdfc.c 11 Nov 2003 11:23:17 -0000 1.41
+++ src/gdevpdfc.c 21 Nov 2003 01:42:17 -0000
@@ -144,21 +144,22 @@
private cie_cache_one_step_t
cie_cached_abc_is_one_step(const gs_cie_abc *pcie, const gs_matrix3
**ppmat)
{
- /* The order of steps is DecodeLMN, MatrixLMN, DecodeABC, MatrixABC. */
- if (CIE_CACHE3_IS_IDENTITY(pcie->caches.DecodeABC.caches)) {
+ /* The order of steps is, DecodeABC, MatrixABC, DecodeLMN, MatrixLMN.
*/
+
+ if (CIE_CACHE3_IS_IDENTITY(pcie->common.caches.DecodeLMN)) {
if (pcie->MatrixABC.is_identity) {
*ppmat = &pcie->common.MatrixLMN;
- return ONE_STEP_LMN;
+ return ONE_STEP_ABC;
}
if (pcie->common.MatrixLMN.is_identity) {
*ppmat = &pcie->MatrixABC;
- return ONE_STEP_LMN;
+ return ONE_STEP_ABC;
}
}
- if (CIE_CACHE3_IS_IDENTITY(pcie->common.caches.DecodeLMN)) {
+ if (CIE_CACHE3_IS_IDENTITY(pcie->caches.DecodeABC.caches)) {
if (pcie->MatrixABC.is_identity) {
*ppmat = &pcie->common.MatrixLMN;
- return ONE_STEP_ABC;
+ return ONE_STEP_LMN;
}
}
return ONE_STEP_NOT;