Return-Path: X-Original-To: apmail-xmlgraphics-batik-dev-archive@www.apache.org Delivered-To: apmail-xmlgraphics-batik-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8B5211130C for ; Wed, 25 Jun 2014 05:52:25 +0000 (UTC) Received: (qmail 42467 invoked by uid 500); 25 Jun 2014 05:52:25 -0000 Delivered-To: apmail-xmlgraphics-batik-dev-archive@xmlgraphics.apache.org Received: (qmail 42432 invoked by uid 500); 25 Jun 2014 05:52:25 -0000 Mailing-List: contact batik-dev-help@xmlgraphics.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: batik-dev@xmlgraphics.apache.org Delivered-To: mailing list batik-dev@xmlgraphics.apache.org Received: (qmail 42288 invoked by uid 99); 25 Jun 2014 05:52:25 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jun 2014 05:52:25 +0000 Date: Wed, 25 Jun 2014 05:52:24 +0000 (UTC) From: "Trejkaz (JIRA)" To: batik-dev@xmlgraphics.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (BATIK-1077) ArrayIndexOutOfBoundsException in AbstractWMFPainter.getImage for 8-bit image inside WMF MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/BATIK-1077?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Trejkaz updated BATIK-1077: --------------------------- Attachment: test.wmf Test file (it's just a WMF inserted by Office as a placeholder icon for an attached document.) > 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-unsubscribe@xmlgraphics.apache.org For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org