[jira] [Commented] (FOP-2549) [PATCH] SVGs with radial gradiant causes PDF display error

2018-03-15 Thread Ivan Lagunov (JIRA)

[ 
https://issues.apache.org/jira/browse/FOP-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16400208#comment-16400208
 ] 

Ivan Lagunov commented on FOP-2549:
---

I've just hit the same issue with the following example:
{code:xml}





{code}

It results in an invalid PDF that fails to open in Adobe Acrobat Reader. I use 
FOP 2.1 with Batik 1.8 (DITA-OT 2.4.6).

> [PATCH] SVGs with radial gradiant causes PDF display error
> --
>
> Key: FOP-2549
> URL: https://issues.apache.org/jira/browse/FOP-2549
> Project: FOP
>  Issue Type: Bug
>  Components: image/svg
>Reporter: Matthias Reischenbacher
>Priority: Major
> Attachments: fop-2549-test-case.pdf, fop-2549-test-case.svg, 
> fop-2549-test-case_wrong.pdf, fop-2549.patch
>
>
> A radial gradiant isn't processed correctly by FOP. E.g. the following 
> gradiant:
> cx="51159.898"
>cy="57300"
>r="5279.6602"
>fx="51159.898"
>fy="57300"
>id="id0"
>gradientUnits="userSpaceOnUse">
>id="stop28"
>style="stop-color:#fefefe;stop-opacity:1"
>offset="0" />
>id="stop30"
>style="stop-color:#cdcece;stop-opacity:1"
>offset="0.58823502" />
>id="stop32"
>style="stop-color:#9d9e9e;stop-opacity:1"
>offset="1" />
>id="stop34"
>style="stop-color:#9d9e9e;stop-opacity:1"
>offset="1" />
>   
> is only outputted with one "Bound" entry in the PDF color function (instead 
> of two).
> When opening the PDF with Adobe Acrobat the SVG is only partially displayed 
> and an error message pops up after clicking on the image.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (FOP-2549) [PATCH] SVGs with radial gradiant causes PDF display error

2017-05-31 Thread simon steiner (JIRA)

[ 
https://issues.apache.org/jira/browse/FOP-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16030983#comment-16030983
 ] 

simon steiner commented on FOP-2549:


Similar to FOP-2710

> [PATCH] SVGs with radial gradiant causes PDF display error
> --
>
> Key: FOP-2549
> URL: https://issues.apache.org/jira/browse/FOP-2549
> Project: FOP
>  Issue Type: Bug
>  Components: image/svg
>Reporter: Matthias Reischenbacher
> Attachments: fop-2549.patch, fop-2549-test-case.pdf, 
> fop-2549-test-case.svg, fop-2549-test-case_wrong.pdf
>
>
> A radial gradiant isn't processed correctly by FOP. E.g. the following 
> gradiant:
> cx="51159.898"
>cy="57300"
>r="5279.6602"
>fx="51159.898"
>fy="57300"
>id="id0"
>gradientUnits="userSpaceOnUse">
>id="stop28"
>style="stop-color:#fefefe;stop-opacity:1"
>offset="0" />
>id="stop30"
>style="stop-color:#cdcece;stop-opacity:1"
>offset="0.58823502" />
>id="stop32"
>style="stop-color:#9d9e9e;stop-opacity:1"
>offset="1" />
>id="stop34"
>style="stop-color:#9d9e9e;stop-opacity:1"
>offset="1" />
>   
> is only outputted with one "Bound" entry in the PDF color function (instead 
> of two).
> When opening the PDF with Adobe Acrobat the SVG is only partially displayed 
> and an error message pops up after clicking on the image.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (FOP-2549) [PATCH] SVGs with radial gradiant causes PDF display error

2015-12-07 Thread Andreas L. Delmelle (JIRA)

[ 
https://issues.apache.org/jira/browse/FOP-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15045377#comment-15045377
 ] 

Andreas L. Delmelle commented on FOP-2549:
--


I think so, especially in this case, given that it is the final stop _and_ has 
the exact same color. 
Reading the SVG spec on gradients, there is an example mentioned with two stops 
having the same offset, but it is not the last one and it has a different 
color, so in that case, the result would be wrong if we just skip it entirely. 
I have not yet tried how FOP currently processes that sample, though...

> [PATCH] SVGs with radial gradiant causes PDF display error
> --
>
> Key: FOP-2549
> URL: https://issues.apache.org/jira/browse/FOP-2549
> Project: FOP
>  Issue Type: Bug
>  Components: image/svg
>Reporter: Matthias Reischenbacher
> Attachments: fop-2549-test-case.pdf, fop-2549-test-case.svg, 
> fop-2549-test-case_wrong.pdf, fop-2549.patch
>
>
> A radial gradiant isn't processed correctly by FOP. E.g. the following 
> gradiant:
> cx="51159.898"
>cy="57300"
>r="5279.6602"
>fx="51159.898"
>fy="57300"
>id="id0"
>gradientUnits="userSpaceOnUse">
>id="stop28"
>style="stop-color:#fefefe;stop-opacity:1"
>offset="0" />
>id="stop30"
>style="stop-color:#cdcece;stop-opacity:1"
>offset="0.58823502" />
>id="stop32"
>style="stop-color:#9d9e9e;stop-opacity:1"
>offset="1" />
>id="stop34"
>style="stop-color:#9d9e9e;stop-opacity:1"
>offset="1" />
>   
> is only outputted with one "Bound" entry in the PDF color function (instead 
> of two).
> When opening the PDF with Adobe Acrobat the SVG is only partially displayed 
> and an error message pops up after clicking on the image.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


Re: [jira] [Commented] (FOP-2549) [PATCH] SVGs with radial gradiant causes PDF display error

2015-12-07 Thread Glenn Adams
Best check the SVG spec (and possibly check with the SVG authors) on this
interpretation before jumping to conclusions.

On Mon, Dec 7, 2015 at 9:52 AM, Matthias Reischenbacher (JIRA) <
j...@apache.org> wrote:

>
> [
> https://issues.apache.org/jira/browse/FOP-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15045224#comment-15045224
> ]
>
> Matthias Reischenbacher commented on FOP-2549:
> --
>
> Thanks for looking into this too, Andreas! So basically the fourth stop
> element needs be ignored, because it makes no sense to have two stop
> elements with the same offset, right?
>
> > [PATCH] SVGs with radial gradiant causes PDF display error
> > --
> >
> > Key: FOP-2549
> > URL: https://issues.apache.org/jira/browse/FOP-2549
> > Project: FOP
> >  Issue Type: Bug
> >  Components: image/svg
> >Reporter: Matthias Reischenbacher
> > Attachments: fop-2549-test-case.pdf, fop-2549-test-case.svg,
> fop-2549-test-case_wrong.pdf, fop-2549.patch
> >
> >
> > A radial gradiant isn't processed correctly by FOP. E.g. the following
> gradiant:
> >  >cx="51159.898"
> >cy="57300"
> >r="5279.6602"
> >fx="51159.898"
> >fy="57300"
> >id="id0"
> >gradientUnits="userSpaceOnUse">
> > >id="stop28"
> >style="stop-color:#fefefe;stop-opacity:1"
> >offset="0" />
> > >id="stop30"
> >style="stop-color:#cdcece;stop-opacity:1"
> >offset="0.58823502" />
> > >id="stop32"
> >style="stop-color:#9d9e9e;stop-opacity:1"
> >offset="1" />
> > >id="stop34"
> >style="stop-color:#9d9e9e;stop-opacity:1"
> >offset="1" />
> >   
> > is only outputted with one "Bound" entry in the PDF color function
> (instead of two).
> > When opening the PDF with Adobe Acrobat the SVG is only partially
> displayed and an error message pops up after clicking on the image.
>
>
>
> --
> This message was sent by Atlassian JIRA
> (v6.3.4#6332)
>


[jira] [Commented] (FOP-2549) [PATCH] SVGs with radial gradiant causes PDF display error

2015-12-07 Thread Matthias Reischenbacher (JIRA)

[ 
https://issues.apache.org/jira/browse/FOP-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15045224#comment-15045224
 ] 

Matthias Reischenbacher commented on FOP-2549:
--

Thanks for looking into this too, Andreas! So basically the fourth stop element 
needs be ignored, because it makes no sense to have two stop elements with the 
same offset, right?

> [PATCH] SVGs with radial gradiant causes PDF display error
> --
>
> Key: FOP-2549
> URL: https://issues.apache.org/jira/browse/FOP-2549
> Project: FOP
>  Issue Type: Bug
>  Components: image/svg
>Reporter: Matthias Reischenbacher
> Attachments: fop-2549-test-case.pdf, fop-2549-test-case.svg, 
> fop-2549-test-case_wrong.pdf, fop-2549.patch
>
>
> A radial gradiant isn't processed correctly by FOP. E.g. the following 
> gradiant:
> cx="51159.898"
>cy="57300"
>r="5279.6602"
>fx="51159.898"
>fy="57300"
>id="id0"
>gradientUnits="userSpaceOnUse">
>id="stop28"
>style="stop-color:#fefefe;stop-opacity:1"
>offset="0" />
>id="stop30"
>style="stop-color:#cdcece;stop-opacity:1"
>offset="0.58823502" />
>id="stop32"
>style="stop-color:#9d9e9e;stop-opacity:1"
>offset="1" />
>id="stop34"
>style="stop-color:#9d9e9e;stop-opacity:1"
>offset="1" />
>   
> is only outputted with one "Bound" entry in the PDF color function (instead 
> of two).
> When opening the PDF with Adobe Acrobat the SVG is only partially displayed 
> and an error message pops up after clicking on the image.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FOP-2549) [PATCH] SVGs with radial gradiant causes PDF display error

2015-12-06 Thread Andreas L. Delmelle (JIRA)

[ 
https://issues.apache.org/jira/browse/FOP-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15044188#comment-15044188
 ] 

Andreas L. Delmelle commented on FOP-2549:
--

Back on topic for this particular issue: the confusion stems -- I think -- from 
the fact that the gradient in the SVG has two stops with the same offset (= 1). 
Somehow -- vague as I am not quite there yet -- this triggers the generation of 
a stitching function where with 3 functions where one would expect 2. Very 
likely, that is what throws off the eventual rendering of the PDF in Acrobat 
Reader. If you comment out or remove the unnecessary second stops in the SVG, 
the sample renders as intended.

Now, I still think this is a bug, but solving it by just adding the extra value 
in the Bounds array would not be appropriate. We just need to fix the code so 
that this case of two stops with the same offset does not trigger the 
generation an extra subfunction (which then makes the Functions array one 
element too long).

> [PATCH] SVGs with radial gradiant causes PDF display error
> --
>
> Key: FOP-2549
> URL: https://issues.apache.org/jira/browse/FOP-2549
> Project: FOP
>  Issue Type: Bug
>  Components: image/svg
>Reporter: Matthias Reischenbacher
> Attachments: fop-2549-test-case.pdf, fop-2549-test-case.svg, 
> fop-2549-test-case_wrong.pdf, fop-2549.patch
>
>
> A radial gradiant isn't processed correctly by FOP. E.g. the following 
> gradiant:
> cx="51159.898"
>cy="57300"
>r="5279.6602"
>fx="51159.898"
>fy="57300"
>id="id0"
>gradientUnits="userSpaceOnUse">
>id="stop28"
>style="stop-color:#fefefe;stop-opacity:1"
>offset="0" />
>id="stop30"
>style="stop-color:#cdcece;stop-opacity:1"
>offset="0.58823502" />
>id="stop32"
>style="stop-color:#9d9e9e;stop-opacity:1"
>offset="1" />
>id="stop34"
>style="stop-color:#9d9e9e;stop-opacity:1"
>offset="1" />
>   
> is only outputted with one "Bound" entry in the PDF color function (instead 
> of two).
> When opening the PDF with Adobe Acrobat the SVG is only partially displayed 
> and an error message pops up after clicking on the image.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FOP-2549) [PATCH] SVGs with radial gradiant causes PDF display error

2015-12-05 Thread Andreas L. Delmelle (JIRA)

[ 
https://issues.apache.org/jira/browse/FOP-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15043435#comment-15043435
 ] 

Andreas L. Delmelle commented on FOP-2549:
--


Also not an expert here, but at any rate, from what I can tell, the problem 
seems to be deeper, and this would be a quick-fix in that it merely 'fakes' an 
extra interval, where there should not really be any. Additionally, whether 
that value of 0.999 (= 99.9%) suffices, may depend on other factors, like the 
output resolution (I think) ? If the precision is increased, you may eventually 
end up with a percentage that is low enough so that it does not produce a 
noticeable difference on any currently available printer/output medium.

So, if I interpret correctly, an SVG gradient is translated into a PDF Type 3 
Stitching Function. A gradient having 3 stops with respective offsets of 0, 0.5 
and 1, could be translated into a function with Domain [0.0, 1.0] and a Bounds 
array of 1 element [0.5].
The first subdomain would then run from 0 (inclusive) to 0.5 (exclusive), the 
second subdomain from 0.5 (inclusive) to 1 (*inclusive*).
I may be the case that something is just going wrong with the processing of the 
last subdomain, for which the PDF spec clearly states that it is the only 
interval that is supposed to be fully closed, on both the left and the right. 
All other subdomains are half-open, closed on the left but open on the right.

> [PATCH] SVGs with radial gradiant causes PDF display error
> --
>
> Key: FOP-2549
> URL: https://issues.apache.org/jira/browse/FOP-2549
> Project: FOP
>  Issue Type: Bug
>  Components: image/svg
>Reporter: Matthias Reischenbacher
> Attachments: fop-2549-test-case.pdf, fop-2549-test-case.svg, 
> fop-2549-test-case_wrong.pdf, fop-2549.patch
>
>
> A radial gradiant isn't processed correctly by FOP. E.g. the following 
> gradiant:
> cx="51159.898"
>cy="57300"
>r="5279.6602"
>fx="51159.898"
>fy="57300"
>id="id0"
>gradientUnits="userSpaceOnUse">
>id="stop28"
>style="stop-color:#fefefe;stop-opacity:1"
>offset="0" />
>id="stop30"
>style="stop-color:#cdcece;stop-opacity:1"
>offset="0.58823502" />
>id="stop32"
>style="stop-color:#9d9e9e;stop-opacity:1"
>offset="1" />
>id="stop34"
>style="stop-color:#9d9e9e;stop-opacity:1"
>offset="1" />
>   
> is only outputted with one "Bound" entry in the PDF color function (instead 
> of two).
> When opening the PDF with Adobe Acrobat the SVG is only partially displayed 
> and an error message pops up after clicking on the image.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FOP-2549) [PATCH] SVGs with radial gradiant causes PDF display error

2015-12-04 Thread Matthias Reischenbacher (JIRA)

[ 
https://issues.apache.org/jira/browse/FOP-2549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15041992#comment-15041992
 ] 

Matthias Reischenbacher commented on FOP-2549:
--

I'm not 100% sure if my patch is correct, because I have never worked with 
shadings before. From what I could deduce so far, is that the function "Bounds" 
are derived from the SVG stop elements. If the stop offset is "1", the function 
Bound isn't correctly processed. Is it valid to assume 0.999... when the offset 
is 1? Using "1" isn't allowed because the Bound values must be within the 
"Domain" (in this case between 0 and 1).

> [PATCH] SVGs with radial gradiant causes PDF display error
> --
>
> Key: FOP-2549
> URL: https://issues.apache.org/jira/browse/FOP-2549
> Project: FOP
>  Issue Type: Bug
>  Components: image/svg
>Reporter: Matthias Reischenbacher
> Attachments: fop-2549-test-case.pdf, fop-2549-test-case.svg, 
> fop-2549-test-case_wrong.pdf, fop-2549.patch
>
>
> A radial gradiant isn't processed correctly by FOP. E.g. the following 
> gradiant:
> cx="51159.898"
>cy="57300"
>r="5279.6602"
>fx="51159.898"
>fy="57300"
>id="id0"
>gradientUnits="userSpaceOnUse">
>id="stop28"
>style="stop-color:#fefefe;stop-opacity:1"
>offset="0" />
>id="stop30"
>style="stop-color:#cdcece;stop-opacity:1"
>offset="0.58823502" />
>id="stop32"
>style="stop-color:#9d9e9e;stop-opacity:1"
>offset="1" />
>id="stop34"
>style="stop-color:#9d9e9e;stop-opacity:1"
>offset="1" />
>   
> is only outputted with one "Bound" entry in the PDF color function (instead 
> of two).
> When opening the PDF with Adobe Acrobat the SVG is only partially displayed 
> and an error message pops up after clicking on the image.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)