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 2008/04/01 01:07:24 UTC
DO NOT REPLY [Bug 44722] New: WMFTranscoder/WMFPainter writes out
"?" instead of numbers in resulting SVG document when attempting to convert a
WMF image without a viewport width specified
https://issues.apache.org/bugzilla/show_bug.cgi?id=44722
Summary: WMFTranscoder/WMFPainter writes out "?" instead of
numbers in resulting SVG document when attempting to
convert a WMF image without a viewport width specified
Product: Batik
Version: 1.7
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: critical
Priority: P2
Component: Utilities
AssignedTo: batik-dev@xmlgraphics.apache.org
ReportedBy: brent.pacheco@cerner.com
Created an attachment (id=21747)
--> (https://issues.apache.org/bugzilla/attachment.cgi?id=21747)
This attachment contains a WMF witha viewport width of 0 and the resulting svg
images after it has been processed by a modified & unmodifed WMFTranscoder
Line 118 on WMFPainter.java resets the scale based on a calculation of scale *
the width in pixels / the viewport width. In the event that the viewport width
is zero, division by zero occurs and a the scale is set as "Infinity." This
causes lots of issues downstream and eventually the SVG file is written out
with "?" in place of numbers in the <path> tags, and the SVG renders completely
blank. If this line is commented out, then the SVG resembles the original WMF,
except that only about half of the original content is rendered in the view
port. See the attachment for the original WMF image and the resulting two SVG
files.
--
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 44722] WMFTranscoder/WMFPainter writes out "?"
instead of numbers in resulting SVG document when attempting to convert a WMF
image without a viewport width specified
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44722
--- Comment #1 from Hervé Girod <he...@club-internet.fr> 2009-07-04 10:17:30 PST ---
The problem is in the big readRecords method, with the META_SETWINDOWEXT
switch. A variable _bext is used to be sure that the viewPort is set only the
first time. In this example, the first META_SETWINDOWEXT records all have 0
width and height. The solution is to allow to reset the viewPort after it has
been set before. It is wise to also not allow to set viewPort if width or
height are 0, as this is an error in the WMF File.
I have applied this solution in my working copy of Batik, and it works. I will
propose the (small) patch soon.
--
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 44722] WMFTranscoder/WMFPainter writes out "?"
instead of numbers in resulting SVG document when attempting to convert a WMF
image without a viewport width specified
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44722
--- Comment #2 from Hervé Girod <he...@club-internet.fr> 2009-07-05 02:19:39 PST ---
I will send a patch as soon as I can, but these lines in WMFRecordStore:
if (_bext && functionId == WMFConstants.META_SETWINDOWEXT) {
vpW = width;
vpH = height;
if (! isotropic) scaleXY = (float)vpW / (float)vpH;
vpW = (int)(vpW * scaleXY);
_bext = false;
}
should be changed to:
if (functionId == WMFConstants.META_SETWINDOWEXT) {
if ((width > 0) && (height > 0)) {
vpW = width;
vpH = height;
if (! isotropic) scaleXY = (float)vpW / (float)vpH;
vpW = (int)(vpW * scaleXY);
}
}
Of course, _bext is not useful anymore. The check for width and height being
greater than 0 is "just in case". There are so many faulty WMF files in the
wild ;)
--
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 44722] WMFTranscoder/WMFPainter writes out "?"
instead of numbers in resulting SVG document when attempting to convert a WMF
image without a viewport width specified
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44722
Brent Pacheco <br...@cerner.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P2 |P1
--
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