Image export failed exeption for emf image in image 23.5

iam currently using your Aspose Image library latest version 23.5 in a Java project and am facing an issue that I need help with.

Here’s a brief summary of my issue:

I’m attempting to load an image file and subsequently save it. However, during the process, an exception with the message “Image export failed” is being thrown
Here’s the test code:
public static void main(String[] args) {
Image image;
image =Image.load(“33.emf”);
long format = image.getFileFormat();
System.out.println("Picture type = "+ counter + getPictureType(format));
ByteArrayOutputStream output = new ByteArrayOutputStream();
ImageOptionsBase imageOptions;
String action;
System.out.println("image format of image = “+counter +” " + getPictureType(format));

    if (format == FileFormat.Jpeg || format == FileFormat.Jpeg2000) {
        imageOptions = new JpegOptions();
        System.out.println("Picture converted to JPEG");
        action = "Picture converted to JPEG";
    } else {
        System.out.println("Picture converted to PNG");

        imageOptions = getPngOptions(image, format);
        action = "Picture converted to PNG";
    }
    try {
        image.save(output, imageOptions);
    } catch (Exception e) {
        System.out.println("extipetion when save file = "+counter + e.getMessage());
        logger.warning("save image failed");

        image.dispose();
        throw new RuntimeException();
    }

    logger.fine(action);
    image.dispose();
}

public static PngOptions getPngOptions(Image image, long format) {
float scale = 1;
PngOptions pngOptions = new PngOptions();
pngOptions.setColorType(PngColorType.TruecolorWithAlpha);
VectorRasterizationOptions rasterizationOptions = null;
if (format == FileFormat.Emf) {
rasterizationOptions = new EmfRasterizationOptions();
try {
if(null!=image.getOriginalOptions().getResolutionSettings()) {
pngOptions.setResolutionSettings(image.getOriginalOptions().getResolutionSettings());
}
} catch (Exception e) {
System.out.println(“extipetion in getResolutionSettings emf”);
}
} else if (format == FileFormat.Wmf) {
rasterizationOptions = new WmfRasterizationOptions();
scale = 1.5f;
}

    if (rasterizationOptions != null) {
        rasterizationOptions.setPageSize(new SizeF(image.getWidth()*scale, image.getHeight()*scale));
        rasterizationOptions.setBackgroundColor(image.hasBackgroundColor() ? image.getBackgroundColor() : Color.getTransparent());
        pngOptions.setVectorRasterizationOptions(rasterizationOptions);
    }

    return pngOptions;
}

img.7z (18.6 KB)

Unfortunately, I haven’t been able to extract a complete stack trace. However, the exception message is: “Image export failed”.
Any assistance you could provide would be greatly appreciated. Please let me know if you require additional information to diagnose this issue.

Best regards,
pavel

i add 2 emf files as an example

Hello, @paveln1234 ,
We will review your request and answer you shortly!

Hello, @paveln1234 ,
We have opened the following new ticket in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): IMAGINGNET-6421

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

any update please?

@paveln1234 , the ticket is planned to enter 23.7 release.

hello do you know when you are going to release the 23.7?

@paveln1234 , by the end of July 2023.

Any update today is the last day of july

The issues you have found earlier (filed as IMAGINGNET-6421) have been fixed in this update. This message was posted using Bugs notification tool by samer.el-khatib