We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Wmf vector image cropping throws exception in Excel files

Hi Team,

I am facing an issue with wmf vector image files embedded in Excel files.
I am trying to crop such a wmf embedded vector file however the cropping does not work, but throws the following exception

Unhandled exception. System.ArgumentOutOfRangeException: The rectangle must entirely contained within the image bounds. (Parameter 'rectangle')
at Aspose.Imaging.FileFormats.Wmf.WmfImage.Crop(Rectangle rectangle)
at Aspose.Imaging.FileFormats.Emf.MetaImage.Crop(Int32 leftShift, Int32 rightShift, Int32 topShift, Int32 bottomShift)

I’ve tried it on windows platform with Aspose.Imaging 21.11 and Aspose.Cells 21.11

I have implemented an example solution to demonstrate this.
Please find it attached.

Thanks, Zoltan
WmfCropppingInExcelException.zip (347.4 KB)


The exception shows that the error seems to be related to Aspose.Imaging API, so I am moving the thread to respective forum where you will be assisted accordingly.

@zpopswat @Amjad_Sahi
I have tested the embedded wmf image with Aspose.Imaging 21.6 and 21.11 and I could not reproduce the error. Could you please provide the content of picture.Data as a separated file and I will test all with him.

@zpopswat @Amjad_Sahi
The problem is detected and I have created the new issue IMAGINGNET-4986.

1 Like