You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by bu...@apache.org on 2010/04/06 12:29:26 UTC
DO NOT REPLY [Bug 49052] New: -dpi setting does not work well.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49052
Summary: -dpi setting does not work well.
Product: Batik
Version: 1.7
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P2
Component: SVG Rasterizer
AssignedTo: batik-dev@xmlgraphics.apache.org
ReportedBy: peterhull90@gmail.com
Created an attachment (id=25234)
--> (https://issues.apache.org/bugzilla/attachment.cgi?id=25234)
zip containing 'good' and 'bad' svg files and pngs at 100 and 200dpi
If an SVG file contains a width/height in 'real' units but no viewBox attribute
on the svg tag, and the image contains graphics in pixel units, the rasterizer
works ok if the -dpi command line parameter is 100 but not otherwise when
converting to raster formats. If, for example, the dpi is set to 200 the image
is physically twice the size but the graphic is not, it stays in the top left
hand corner.
Rasterizer must be using an implicit DPI of 100 to draw the graphic so it
probably should generate an implicit viewBox based on the width/height. As far
as I can see the viewBox is not required by SVG and the observed behaviour is
not in the SVG spec, apologies if I have missed it.
This file is affected
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" height="10cm" version="1.1"
width="10cm">
<rect height="350" fill="#d8d8d8" stroke="black" width="350" x="25" y="25"/>
</svg>
With an added viewBox it works correctly
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" height="10cm" version="1.1"
width="10cm" viewBox="0 0 394 394">
<rect height="350" fill="#d8d8d8" stroke="black" width="350" x="25" y="25"/>
</svg>
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org
DO NOT REPLY [Bug 49052] -dpi setting does not work well.
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49052
Thomas Deweese <de...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |INVALID
--- Comment #1 from Thomas Deweese <de...@apache.org> 2010-04-06 10:49:10 UTC ---
It sounds like the '-dpi' switch is working fine.
The 'dpi' switch changes the mapping from realworld units to userspace
units. Not the other way around. So without the viewBox attribute you are
changing the effective width and height of the SVG in userspace but
your document uses the same portion of the userspace.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org