https://issues.apache.org/bugzilla/show_bug.cgi?id=50056

--- Comment #2 from [email protected] 2010-10-08 11:03:29 EDT ---
Created an attachment (id=26141)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26141)
A patch

The problem reproduces in the current trunk version, it is platform and java
version idependent, but I use Windows XP and java 1.6. Problem was caused from
command line. Here is a test case, you could merge it somewhere:

package test;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;

import org.apache.batik.transcoder.TranscoderInput;
import org.apache.batik.transcoder.TranscoderOutput;
import org.apache.batik.transcoder.wmf.tosvg.WMFTranscoder;

import junit.framework.TestCase;

public class TestBug50056 extends TestCase {

    public void test() throws Exception {
        File f = new File("D:/tmp/failingfile.wmf");
        InputStream is = new FileInputStream(f);

        TranscoderInput wmfInput = new TranscoderInput(new FileInputStream(f));
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        TranscoderOutput svgOutput = new TranscoderOutput(baos);
        WMFTranscoder wmfTranscoder = new WMFTranscoder();
        wmfTranscoder.addTranscodingHint(WMFTranscoder.KEY_WIDTH, new
Float(100));
        wmfTranscoder.addTranscodingHint(WMFTranscoder.KEY_HEIGHT, new
Float(100));

        // this fails with an ArrayIndexOutOfBoundsException if bug 50056
reproduces
        wmfTranscoder.transcode(wmfInput, svgOutput);
    }

}

-- 
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]

Reply via email to