You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by bu...@apache.org on 2009/03/20 09:44:43 UTC

DO NOT REPLY [Bug 46882] New: ArrayIndexOutOfBoundsException when applying a CMYK color in PDFGraphics2D

https://issues.apache.org/bugzilla/show_bug.cgi?id=46882

           Summary: ArrayIndexOutOfBoundsException when applying a CMYK
                    color in PDFGraphics2D
           Product: Fop
           Version: 1.0dev
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: pdf
        AssignedTo: fop-dev@xmlgraphics.apache.org
        ReportedBy: yegor@dinom.ru


There are two bugs in PDFGraphics2D.applyColor.

Firstly, when applying a color with CMYK colorspace the number of components is
4, not 3.
See line 744:
  float[] cComps = c.getColorComponents(new float[3]); //results in
ArrayIndexOutOfBoundsException

Secondly, Color.getColorComponents returns values in the range [0, 1] while
PDFColor expects them in the [0, 255] range.

I attached the patch and a sample program to reproduce the trouble.

Regards,
Yegor kozlov

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 46882] ArrayIndexOutOfBoundsException when applying a CMYK color in PDFGraphics2D

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46882





--- Comment #1 from Yegor Kozlov <ye...@dinom.ru>  2009-03-20 01:45:18 PST ---
Created an attachment (id=23394)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23394)
the patch

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 46882] [PATCH] ArrayIndexOutOfBoundsException when applying a CMYK color in PDFGraphics2D

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46882


Jeremias Maerki <je...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |PatchAvailable
            Summary|ArrayIndexOutOfBoundsExcept |[PATCH]
                   |ion when applying a CMYK    |ArrayIndexOutOfBoundsExcept
                   |color in PDFGraphics2D      |ion when applying a CMYK
                   |                            |color in PDFGraphics2D




-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 46882] [PATCH] ArrayIndexOutOfBoundsException when applying a CMYK color in PDFGraphics2D

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46882

Glenn Adams <gl...@skynav.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |CLOSED

--- Comment #4 from Glenn Adams <gl...@skynav.com> 2012-04-01 06:49:10 UTC ---
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 46882] ArrayIndexOutOfBoundsException when applying a CMYK color in PDFGraphics2D

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46882





--- Comment #2 from Yegor Kozlov <ye...@dinom.ru>  2009-03-20 01:45:48 PST ---
Created an attachment (id=23395)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23395)
sample program to reproduce the trouble

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 46882] [PATCH] ArrayIndexOutOfBoundsException when applying a CMYK color in PDFGraphics2D

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46882


Jeremias Maerki <je...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




--- Comment #3 from Jeremias Maerki <je...@apache.org>  2009-03-23 00:49:10 PST ---
Thanks for noticing that bug. I've just fixed it but not using your patch as it
contained a bug (*256 is not correct) and it was possible to this in a much
simpler way.

http://svn.apache.org/viewvc?rev=757338&view=rev

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.