You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xmlgraphics.apache.org by bu...@apache.org on 2012/05/02 15:33:56 UTC

[Bug 53177] New: [PATCH]

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

          Priority: P2
            Bug ID: 53177
          Assignee: general@xmlgraphics.apache.org
           Summary: [PATCH]
          Severity: normal
    Classification: Unclassified
                OS: Linux
          Reporter: rmeyer@hotmail.co.uk
          Hardware: PC
            Status: NEW
           Version: Trunk
         Component: Java2D
        Depends on: 48723
           Product: XMLGraphicsCommons

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 53177] [PATCH] Fix for XGC when rendering PostScript using SVG being drawn upside down when using a custom affine transform.

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

--- Comment #5 from Glenn Adams <ga...@apache.org> ---
(In reply to comment #4)
> Thanks for applying this patch Glenn, I added the Hamcrest JAR to which
> Mockito has a transitive dependency r1333083.

thanks; i guess the current xgc junit doesn't tickle that dependency since it
ran without error after i added mockito and objenesis jars

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 53177] [PATCH] Fix for XGC when rendering PostScript using SVG being drawn upside down when using a custom affine transform.

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

--- Comment #4 from Mehdi Houshmand <me...@gmail.com> ---
Thanks for applying this patch Glenn, I added the Hamcrest JAR to which Mockito
has a transitive dependency r1333083.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 53177] [PATCH] Fix for XGC when rendering PostScript using SVG being drawn upside down when using a custom affine transform.

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

Bug 53177 depends on bug 48723, which changed state.

Bug 48723 Summary: SVG Image Rendered Upside Down in PostScript
https://issues.apache.org/bugzilla/show_bug.cgi?id=48723

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

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 53177] [PATCH] Fix for XGC when rendering PostScript using SVG being drawn upside down when using a custom affine transform.

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

--- Comment #6 from Mehdi Houshmand <me...@gmail.com> ---
Yeah, no biggy. Hamcrest is needed for some of the matchers that Mockito uses
which Rob hasn't used here.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 53177] [PATCH] Fix for XGC when rendering PostScript using SVG being drawn upside down when using a custom affine transform.

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

rmeyer@hotmail.co.uk changed:

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

--- Comment #7 from rmeyer@hotmail.co.uk ---
Thanks for applying the patch. I have verified the changes and will now set the
status to closed / fixed.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 53177] [PATCH] Fix for XGC when rendering PostScript using SVG being drawn upside down when using a custom affine transform.

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

Glenn Adams <ga...@apache.org> changed:

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

--- Comment #3 from Glenn Adams <ga...@apache.org> ---
patch landed at:

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

thanks rmeyer! please verify and close if satisfied

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 53177] [PATCH] Fix for XGC when rendering PostScript using SVG being drawn upside down when using a custom affine transform.

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

rmeyer@hotmail.co.uk changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[PATCH] Fix for SVG where   |[PATCH] Fix for XGC when
                   |in PostScript it was being  |rendering PostScript using
                   |upside down when using a    |SVG being drawn upside down
                   |custom affine transform.    |when using a custom affine
                   |                            |transform.

--- Comment #2 from rmeyer@hotmail.co.uk ---
PostScript documents are by default drawn from the bottom up, because of this
FOP changes the Y axis for each generated PS file so everything on the page is
inverted and can be displayed in the same way as other document types such as
PDF. 

If however, an SVG drawing co-ordinates were specified from the top down, a
custom transform would need to be applied to counter FOP's automatic switch.
The problem was that a checkTransform method prevented any new transform
matching the current page transform from being applied. This original intention
of this checkTransform method was to reduce the number of times the same
transform is applied to the postscript file thus reducing its size. This is
because if a transform is applied to an SVG drawing, for each shape being drawn
the transform is applied at the shape level instead of at a drawing or
subsequent svg parent level.

Where the checkTransform method fails is that it only checks for one outcome
which is the initial page transform which in this case causes the problem. If
you change the transform to invert the drawing by one pixel less e.g. [ ... 791
] instead of [ ... 792 ] the transform would be applied on each shape and it
would appear correctly (albeit a little off centre). This is because the
transform is applied for the shape and then the graphics state is reverted
meaning the current page state is never changed and the only transform it would
ever ignore would be one matching the original FOP inversion transform.

As such I have removed this method and added a test unit case to prove it is
now concatenating the affine transform correctly. The checkTransform method was
a good idea, but due to the way Batik, Fop and XGC passing transforms onto
child objects this is not currently possible to implement a fix and subsqeuent
reduction in PS file sizes.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 53177] [PATCH] Fix for SVG where in PostScript it was being upside down when using a custom affine transform.

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

--- Comment #1 from rmeyer@hotmail.co.uk ---
Created attachment 28708
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=28708&action=edit
Code changes applied including a test case

A new dependency to Mockito has been added for the test case

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 53177] [PATCH] Fix for SVG where in PostScript it was being upside down when using a custom affine transform.

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

rmeyer@hotmail.co.uk changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[PATCH]                     |[PATCH] Fix for SVG where
                   |                            |in PostScript it was being
                   |                            |upside down when using a
                   |                            |custom affine transform.

-- 
You are receiving this mail because:
You are the assignee for the bug.