Trejkaz created BATIK-1077: ------------------------------ Summary: ArrayIndexOutOfBoundsException in AbstractWMFPainter.getImage for 8-bit image inside WMF Key: BATIK-1077 URL: https://issues.apache.org/jira/browse/BATIK-1077 Project: Batik Issue Type: Bug Components: Utilities Reporter: Trejkaz Attachments: test.wmf
I get this error trying to get an image for a WMF. {noformat} java.lang.ArrayIndexOutOfBoundsException: 9064 at org.apache.batik.transcoder.wmf.tosvg.AbstractWMFPainter.getImage(AbstractWMFPainter.java:162) at org.apache.batik.transcoder.wmf.tosvg.AbstractWMFPainter.getImage(AbstractWMFPainter.java:74) at org.apache.batik.transcoder.wmf.tosvg.WMFPainter.paint(WMFPainter.java:837) {noformat} I had a quick look already. 28 00 00 00 = header size (40 bytes) c0 00 00 00 = width of image (192) 2f 00 00 00 = height of image (47) 01 00 = number of planes (1) 08 00 = bits per pixel (8) 00 00 00 00 40 23 00 00 = size of the image (9024) 00 00 00 00 00 00 00 00 00 00 00 00 = number of used colours (0, meaning "use all of them") 00 00 00 00 <- end of header (40th byte) 192 (width) x 47 (height) x 1 (bytes per pixel) x 1 (planes) = 9024 Header = 40 bytes Palette = 256 bytes (2^8 because it's 8 bits per pixel) Size of image = 9024 bytes (from calculation above) Total size = 9320 > 9068 bytes available data Despite these calculations seeming to show that the image is invalid, it does open in OpenOffice perfectly fine, leading me to wonder how they are doing that... -- This message was sent by Atlassian JIRA (v6.2#6252) --------------------------------------------------------------------- To unsubscribe, e-mail: batik-dev-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: batik-dev-h...@xmlgraphics.apache.org