.cdr file load failed

Hello.

I tried to convert .cdr file to .png file using Aspose.Imaging(ver 24.10.0) with C#.
The .cdr file used in the test is confidential, so i can only share it in a private message.
Call the Image.Load function causes some errors depending on the .cdr file.

  1. NullReferenceException: Object reference not set to an instance of an object.
  2. StreamReadException: Read bytes count is not equal to actual bytes count.

The test environment is as follows.

  1. Windows 10 (Korean)
  2. CorelDraw X7 (1710)
  3. The .cdr file has many pages

The test code is as follows.

public static Bitmap ToPng(string inputPath, float scale)
{
	try
	{
		var option = new LoadOptions()
		{
			ProgressEventHandler = (ProgressEventHandlerInfo info) =>
			{
				Console.WriteLine($"CdrConverter.ToPng(string inputPath, float scale) = {info.EventType} : {info.Value} / {info.MaxValue}");
			},
		};
		using (var image = (CdrImage)Aspose.Imaging.Image.Load(inputPath, option))
		{
			if (scale != 1.0f)
			{
				var resizeWidth = image.Width * scale;
				var resizeHeight = image.Height * scale;
				image.Resize((int)resizeWidth, (int)resizeHeight);
			}

			return ToPng(image);
		}
	}
	catch (Exception ex)
	{
		throw ex;
	}
}

private static Bitmap ToPng (Aspose.Imaging.Image image)
{
	using (var ms = new MemoryStream())
	{
		var options = new PngOptions();
		options.ColorType = Aspose.Imaging.FileFormats.Png.PngColorType.TruecolorWithAlpha;
		options.VectorRasterizationOptions = (VectorRasterizationOptions)image.GetDefaultOptions(new object[] { Aspose.Imaging.Color.White, image.Width, image.Height });
		options.VectorRasterizationOptions.TextRenderingHint = TextRenderingHint.SingleBitPerPixel;
		options.VectorRasterizationOptions.SmoothingMode = SmoothingMode.None;

		image.Save(ms, options);
		ms.Position = 0;
		return new Bitmap(ms);
	}
}

Hello, @dev9 ,
It is complicated to point out the error cause you are facing without the input .cdr file. Would you mind to share it as a private message, so we can review the issue and give a feedback?

@Denis.Sitko
I sent you a private message with files.
Please review it.
Thanks.

@dev9 , we are reviewing your request. You will be answered shortly!

@dev9
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-7427

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.

@Denis.Sitko
Thanks for your support.
I hope this issue will be dealt with as soon as possible.
I will visit this topic often for issue tracking.
Have a good day :smiley: