Open hshafie opened 3 years ago
Did not reproduce on JDK1.7.
Please find attached to this message image9.wmf
which seems to trigger the same bug. This WMF is loaded just fine by MS-Word and LibreOffice. See attached screenshot.
java -jar ../tapes/wmf2svg-0.9.11.jar image9.wmf image9.svg
I get more or less the following stack trace whatever the Java runtime I use on my Linux box: Java 8, Java 11 or the very latest Java 20. (Don't have Java 17 handy, sorry.)
java.io.EOFException
at java.desktop/javax.imageio.stream.ImageInputStreamImpl.readFully(ImageInputStreamImpl.java:393)
at java.desktop/com.sun.imageio.plugins.bmp.BMPImageReader.read1Bit(BMPImageReader.java:1119)
at java.desktop/com.sun.imageio.plugins.bmp.BMPImageReader.read(BMPImageReader.java:958)
at java.desktop/javax.imageio.ImageIO.read(ImageIO.java:1466)
at java.desktop/javax.imageio.ImageIO.read(ImageIO.java:1363)
at net.arnx.wmf2svg.util.ImageUtil$ImageIOConverter.convert(ImageUtil.java:62)
at net.arnx.wmf2svg.util.ImageUtil.convert(ImageUtil.java:44)
at net.arnx.wmf2svg.gdi.svg.SvgGdi.bmpToSvg(SvgGdi.java:1567)
at net.arnx.wmf2svg.gdi.svg.SvgGdi.stretchDIBits(SvgGdi.java:1203)
at net.arnx.wmf2svg.gdi.svg.SvgGdi.dibStretchBlt(SvgGdi.java:428)
at net.arnx.wmf2svg.gdi.wmf.WmfParser.parse(WmfParser.java:597)
at net.arnx.wmf2svg.Main.main(Main.java:141)
Note that the bug fix I suggested in my first message prevents Java from throwing the above exception, but generates an SVG graphic which is displayed as a black rectangle by Inkscape, Batik, Firefox and as a very, very "fuzzy", unusable, graphic by Chrome. In other words, the bug fix I suggested is not good enough.
Thank you so much for your patience and for your help!
Hello,
First of all, I'm a long time user of your wmf2svg library and I'm very thankful to you for your hard work. I really wish an equivalent library also would exist for EMF.
When I try to convert this .wmf file as follows:
The conversion works, but I get several of this exception:
This issue may be reproduced whatever the Java platform and is not a regression as it was already there in wmf2svg version 0.9.7.
I made the following quick and dirty change to "src/net/arnx/wmf2svg/gdi/svg/SvgGdi.java" to workaround this issue:
Note that adding the version="1.0" attribute to the svg root is not related to this is issue. It's just nice having it.
Dessin3.wmf.zip