Bug 34847 - incorrect image rendering
Summary: incorrect image rendering
Status: RESOLVED FIXED
Alias: None
Product: Batik - Now in Jira
Classification: Unclassified
Component: SVG Rasterizer (show other bugs)
Version: 1.5
Hardware: Other Windows 2000
: P2 major
Target Milestone: ---
Assignee: Batik Developer's Mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-10 19:26 UTC by Sathish
Modified: 2005-05-15 12:24 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sathish 2005-05-10 19:26:40 UTC
Using the sample file copied below:
The file has a viewbox of width 352 and height 416. The svg elements width and
height is set to 100%. So (if my understanding is correct) the image should
scale itself to any dimension.

But when i try to rasterize it by supplying width value as 352 and height value
as 416 -- i get an image (of size 352 and 416) in which the svg content does not
occupy the entire area of the canvas --the image occupies 310x366 pixels on the
top left and the rest (in right and bottom of the image) is shown transparent.

The problem does not happen if the image is rastererized to a different size say
352x500.

================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
<svg baseProfile="tiny" height="100%" preserveAspectRatio="xMidYMid meet"
version="1.0" viewBox="0 0 352 416" width="100%"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
zoomAndPan="magnify">
<switch>
<foreignObject content="structured text" height="1"
requiredExtensions="http://ns.adobe.com/AdobeIllustrator/10.0/" width="1" x="0"
y="0"/>
<g>
<g>
<radialGradient cx="176" cy="208" fx="176" fy="208"
gradientUnits="userSpaceOnUse" id="XMLID_1_" r="192.6655">
<stop offset="0" style="stop-color:#EFF60B"/>
<stop offset="1" style="stop-color:#EF0003"/>
</radialGradient>
<path d="M352,416H0V0h352V416z" fill="url(#XMLID_1_)"/>
</g>
</g>
</switch>
</svg>
================================================================
Comment 1 Sathish 2005-05-10 19:35:08 UTC
I should add that it even works for 352x417
Comment 2 Sathish 2005-05-11 09:57:15 UTC
Checking further i see that this problem is happening only with files having
gradients defined in it.
Comment 3 Thomas Deweese 2005-05-11 11:48:02 UTC
This works for me.
How are you rasterizing the file?
Can you test:

./build.sh svgrasterizer -w 352 -h 416 test.svg
Comment 4 Sathish 2005-05-11 16:11:20 UTC
(In reply to comment #3)
> This works for me.
> How are you rasterizing the file?
> Can you test:
> 
> ./build.sh svgrasterizer -w 352 -h 416 test.svg

I use the command line as below
C:\software\batik\batik-1.6>java -jar batik-rasterizer.jar -w 352 -h 416 test.svg

The version details are:
1) java ->"1.5.0_02"
2) batik ->1.5.1 and 1.6 (from the release zip files)
Comment 5 Sathish 2005-05-11 16:26:18 UTC
(In reply to comment #3)
> This works for me.
> How are you rasterizing the file?
> Can you test:
> 
> ./build.sh svgrasterizer -w 352 -h 416 test.svg

I tested with the command 
C:\software\batik\xml-batik>build.bat svgrasterizer -w 352 -h 416 test.svg

I still have the problem -- could it be anything to do with the OS (seeing ur
batch file ending with .sh -- the only difference i could think of is that - i
am trying it on windows 2000 and u are on linux/mac/unix machine.
Comment 6 Thomas Deweese 2005-05-12 12:11:14 UTC
I use cygwin on Windows so we are both on the same OS.
The problem turned out to be the JDK version, with
JDK 1.3.1 you don't get the problem with 1.4.2 & 1.5
you do.  I'll look into it now that I can reproduce it.
Comment 7 Thomas Deweese 2005-05-15 20:24:02 UTC
This is now fixed in CVS.