Bug 89182

Summary: Wrong colour shown when GouraudTriangleShFill uses a DeviceN colorspace
Product: poppler Reporter: Thomas Freitag <Thomas.Freitag>
Component: splash backendAssignee: poppler-bugs <poppler-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: The PDF which is rendered wrong
The red square is shown blue
This patch solves it
red square is shown red again

Description Thomas Freitag 2015-02-17 09:17:33 UTC
Created attachment 113556 [details]
The PDF which is rendered wrong

The attached PDF is rendered wrong when using SPLASH_CMYK: instead of a red square a blue square is drawn.

How to reconstruct:
Compile poppler with SPLASH_CMYK defined. Then call
./utils/pdftoppm -png -cropbox -overprint pur_red.pdf pur_red
with the attached PDF
Comment 1 Thomas Freitag 2015-02-17 09:18:09 UTC
Comment on attachment 113556 [details]
The PDF which is rendered wrong

>%PDF-1.6
%âãÏÓ
>11 0 obj
<</Linearized 1/L 7308/O 13/E 2363/N 1/T 6990/H [ 472 151]>>
endobj
                     
>19 0 obj
<</DecodeParms<</Columns 4/Predictor 12>>/Filter/FlateDecode/ID[<443A32303135303230343039353835312B303127303027><A6E6F3041BD44449BADE7E0FCD63BF00>]/Index[11 12]/Info 10 0 R/Length 56/Prev 6991/Root 12 0 R/Size 23/Type/XRef/W[1 2 1]>>stream
>hÞbbd``b`¾ ÖS ÁøD|@+ø!ÅÀÄÈ0¤é?ãÉÿÇIó
>endstream
endobj
startxref
>0
>%%EOF
>        
>22 0 obj
<</Filter/FlateDecode/I 92/Length 67/S 38/V 70>>stream
>hÞb```c``Re¶zTÀÄ,
HblPÌÀð³AP¦ÓB3]«fa`â2:審
>endstream
endobj
12 0 obj
<</AcroForm 20 0 R/Metadata 2 0 R/Pages 9 0 R/Type/Catalog>>
endobj
13 0 obj
<</ArtBox[0.000229 0.000237 259.653748 286.514465]/Contents 14 0 R/CropBox[0 0 259.653992 368.503937]/MediaBox[0 0 259.653992 368.503937]/OneVisionPageColorsInfo<</CreationDate(D:20150204095851+01'00')/PageProcessColors[/Magenta/Yellow/Black]>>/OneVisionVLedgerlines[5.669291 91.41732 255.472443]/Parent 9 0 R/Resources<</ColorSpace<</CS0 21 0 R>>/ProcSet[/PDF/Text/ImageB]/Shading<</Sh0 18 0 R>>>>/Rotate 0/TrimBox[0.000229 0.000237 259.653748 286.514465]/Type/Page>>
endobj
14 0 obj
<</Filter/FlateDecode/Length 155>>stream
>HdÁ
>Â0Dïûóé¦MÚÍUéQ°´bo¢­Vðó=H@æòv;1Rn*­|ÿqQ²lbÃ	:c¢X1ÄÄÔÝvÿ~¶o~ÞÅOqciS¨ÜVì,¾Ïi1ñÔNtî,R¥­i×#kc	¨{4u§ç¥»½×ú:¬8©ù0ïí4
>endstream
endobj
15 0 obj
<</Filter/FlateDecode/First 12/Length 146/N 2/Type/ObjStm>>stream
>hÞ22P0P02T040U°±ÑwqÔÐ÷HÍ)
>¤tM}  k^r~Jf^:àâæP°*²³ÓwËÏ+ÊuÄô£]Ì!Ò ©9)ÅѱvvÑú.©eÉ©~Ñú¾é©y%ú©99ùåúN9ÉÙ±PigßHoC°Y±ñ0
>endstream
endobj
16 0 obj
<</Domain[0 1 0 1 0 1]/Filter/FlateDecode/FunctionType 4/Length 99/Range[0 1 0 1 0 1 0 1]>>stream
>HªN)-P0PÈ-ÍQH­HÎP Ì5DpòÌtòsrHÓ&2ÉTAקI¸µb1ÉÂ,.MR0QÈÌKI­@)EâZ(@müº@~CÆßÅTñg-@m«ÙW
>endstream
endobj
17 0 obj
<</BitsPerSample 8/Domain[0 1]/Encode[0 255]/Filter/FlateDecode/FunctionType 0/Length 105/Range[0 1 0 1 0 1]/Size[256]>>stream
>HTÂÇ
À	ìØE±÷b¯ûâ?&w¹ìóÎ~_~úá»o¾úâ³O>úàÔ{'½óÖ¯½òÒÏ=óÔ=òÐ÷¹ç®CwÜvËM7\wÍU®¸ì.8ïÜÿWзl
>endstream
endobj
18 0 obj
<</BitsPerComponent 16/BitsPerCoordinate 32/BitsPerFlag 8/ColorSpace 21 0 R/Decode[-1 1 -1 1 0 1]/Filter/FlateDecode/Function 17 0 R/Length 31/ShadingType 4>>stream
>xchÿÿþC@LpÀdB¨åí
>endstream
endobj
1 0 obj
<</Filter/FlateDecode/First 15/Length 633/N 3/Type/ObjStm>>stream
>hÞ|ÍnÛ0Ç_ÅO06i¦@ [=,ÀÐkshh¶Ê«lÙÓק]ìüÿHb¼*®ÛâvY¬Åõ²¸¿Ïè«ë#|#{¤hBÙ+§Mß°èªøØQÂSªâi xæÇ"?aD7yWê¦+AØW|¨þË>º&O½¢ðsy§#BïzPÆ«ÔÕþv".Ѧ¾A:)k\Ooà¹$Dc5×wð\¤À.KÅÝ
>G*Ë5TÉZ ±iÈ_º²@Ö!Ôi-P_µuj*n§IÆæ´êøayÓ´:Ó§ùغ°×Ò§¯x8Ñ!d¶>ü3gNñèQSþ
jÃ}Á÷`Ç÷%<ɨ^´á!gxÌR¬HAÈßü*«+(wüãTòãØXñ¸7ê+ôl­aJ¬Üpæ×5ñMÏs½]u
¯í]OüÐT§Æ>ièPå¨ñD0ØdVñ·fØrl²P¥HÐ¥b±¾ìÓãÕçl´±ï}Òs?lnh½ï	=ãÏm-ÎÎP,î°Í[©¶-Û6¯l§£oómKør)_
>\
>\Îàr¢v¢Ùf7Óì&M[xr{ïE¾É÷gÁDuÉF3Øìår=ÌÐÃļHð¹uW|Ç;ZÙ(,Jg,JYR`òßó2¦LeDcDcf3iÇÐK9'r'r7»³`¢´9Ñ!CH&ÓLq`ÌC8]Ü¿ätùôm6ÿìó
>endstream
endobj
2 0 obj
<</Length 3360/Subtype/XML/Type/Metadata>>stream
><?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
><x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.4-c005 78.147326, 2012/08/23-13:03:03        ">
>   <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
>      <rdf:Description rdf:about=""
>            xmlns:xmp="http://ns.adobe.com/xap/1.0/"
>            xmlns:pdf="http://ns.adobe.com/pdf/1.3/"
>            xmlns:dc="http://purl.org/dc/elements/1.1/"
>            xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/">
>         <xmp:ModifyDate>2015-02-16T15:39:50+01:00</xmp:ModifyDate>
>         <xmp:CreateDate>2015-01-19T16:47:43+01:00</xmp:CreateDate>
>         <xmp:CreatorTool>CorelDRAW Version 12.0</xmp:CreatorTool>
>         <xmp:MetadataDate>2015-02-16T15:39:50+01:00</xmp:MetadataDate>
>         <pdf:Producer>OneVision PDFengine (Windows 64bit Build 27.026.R)</pdf:Producer>
>         <dc:format>application/pdf</dc:format>
>         <dc:title>
>            <rdf:Alt>
>               <rdf:li xml:lang="x-default">Geprüft Gebrauchtwagen</rdf:li>
>            </rdf:Alt>
>         </dc:title>
>         <xmpMM:DocumentID>uuid:03d74d01-1830-40ea-a5b3-fc23dade2dc9</xmpMM:DocumentID>
>         <xmpMM:InstanceID>uuid:8cecb6cd-483d-4760-8511-65fb79e6a31b</xmpMM:InstanceID>
>      </rdf:Description>
>   </rdf:RDF>
></x:xmpmeta>
>                                                                                                    
>                                                                                                    
>                                                                                                    
>                                                                                                    
>                                                                                                    
>                                                                                                    
>                                                                                                    
>                                                                                                    
>                                                                                                    
>                                                                                                    
>                                                                                                    
>                                                                                                    
>                                                                                                    
>                                                                                                    
>                                                                                                    
>                                                                                                    
>                                                                                                    
>                                                                                                    
>                                                                                                    
>                                                                                                    
>                           
><?xpacket end="w"?>
>endstream
endobj
3 0 obj
<</Filter/FlateDecode/First 4/Length 49/N 1/Type/ObjStm>>stream
>hÞ²T0P°±ÑwÎ/Í+Q0Ô÷ÎL)64
>ÅêT¤ê$¦§ÛÙà5¯
>endstream
endobj
4 0 obj
<</Filter/FlateDecode/First 5/Length 230/N 1/Type/ObjStm>>stream
>hÞ¤AkÂ0ÿJn&í÷Å&®C× ÛaLtÔ Õ~vl1Õ?¿Ãéa;íúò<ïÀM&i¨Ö;SEâæ^*@ÌQgãl4Äå/| Ö¬fVR8]52>ûº Q£å
>n/Jû-üÖA®îþ_Ãkß)ø~{ñ®iéÉð]^Ã9êYw~¬zÄ2øº;Pà·-Í\c±-ßXWûËélo#{èl[39N@êdµ"ý§þjcK|AïáóÙö¡êoñR5äÄtú%ÀÍ|*
>endstream
endobj
5 0 obj
<</DecodeParms<</Columns 4/Predictor 12>>/Filter/FlateDecode/ID[<443A32303135303230343039353835312B303127303027><A6E6F3041BD44449BADE7E0FCD63BF00>]/Info 10 0 R/Length 49/Root 12 0 R/Size 11/Type/XRef/W[1 2 1]>>stream
>hÞbb&FNk&æë@7H0ög ÄÓM@#`ú$û
>endstream
endobj
startxref
>116
>%%EOF
Comment 2 Thomas Freitag 2015-02-17 09:21:32 UTC
Created attachment 113557 [details]
The red square is shown blue

(Sorry for comment 1)

Here the result of 
./utils/pdftoppm -png -cropbox -overprint pur_red.pdf pur_red
Comment 3 Thomas Freitag 2015-02-17 09:25:42 UTC
Created attachment 113558 [details] [review]
This patch solves it

The reason is that the color components of a DeviceN colorspace can't be just copied to the splash bitmap, even not in CMYK or DeviceN splash bitmap. The color must always be converted. This patch solves it.
Comment 4 Thomas Freitag 2015-02-17 09:28:59 UTC
Created attachment 113559 [details]
red square is shown red again

Here the result of 
./utils/pdftoppm -png -cropbox -overprint pur_red.pdf pur_red_patch
after apllying the patch
Comment 5 Albert Astals Cid 2015-03-06 14:20:26 UTC
Pushed

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.