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: [email protected]
ReportedBy: [email protected]
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: [email protected]
For additional commands, e-mail: [email protected]