NegativeArraySizeException Converting WMF Files Using Version 1.3.3.0

Last post 02-05-2009, 12:03 PM by BrentP. 3 replies.
Sort Posts: Previous Next
  •  02-03-2009, 4:43 PM 163253

    NegativeArraySizeException Converting WMF Files Using Version 1.3.3.0

    Attachment: Present (inaccessible)
    Hi,

    I have been utilizing a free API for transforming WMF files into PNG files and which is very buggy, so I thought I'd download Aspose Metafile 1.3.3.0 to see how it compares.  On the whole, I've had really good success rendering files that the other API can't handle, but there are a couple of WMFs that end up throwing the following exception:

    Exception in thread "main" java.lang.NegativeArraySizeException
        at java.awt.image.DataBufferByte.<init>(DataBufferByte.java:42)
        at java.awt.image.Raster.createInterleavedRaster(Raster.java:253)
        at java.awt.image.BufferedImage.<init>(BufferedImage.java:367)

    For these cases, the height or width attributes on the WmfMetalfile return a negative value and apparently chokes later on trying to create an array with a negative size.  I can view the WMF fine in Windows and can translate it to a PNG using the other API correctly.  I've attached the WMF files that cause the code to throw this exception.

    Thanks!
     
  •  02-03-2009, 11:22 PM 163271 in reply to 163253

    Re: NegativeArraySizeException Converting WMF Files Using Version 1.3.3.0

    Hello,

    Thank you for the metafiles, we will investigate this issue and fix.

    Alexey Zhilin
    Team Leader
    Aspose Tyumen Team
    About Us
    Contact Us
     
  •  02-05-2009, 5:37 AM 163596 in reply to 163253

    Re: NegativeArraySizeException Converting WMF Files Using Version 1.3.3.0

    We have published new Aspose.Metafiles 1.4 release.
    You can download it here.

    Alexey Zhilin
    Team Leader
    Aspose Tyumen Team
    About Us
    Contact Us
     
  •  02-05-2009, 12:03 PM 163717 in reply to 163596

    Re: NegativeArraySizeException Converting WMF Files Using Version 1.3.3.0

    I just validated that it works - thanks for such an amazingly fast turnaround on this!
     
View as RSS news feed in XML