Chart.ToImage(...) returns "java.lang.Exception: Image format(TIFF) is not supported." error

Hello,
we have found a problem, using Aspose Cells version 24.1, when we try to save a chart as image, using Chart.toImage(OutputStream stream, ImageOrPrintOptions options).

The error is:
java.lang.Exception: Image format(TIFF) is not supported.

If we create ImageOrPrintOptions as follow

ImageOrPrintOptions opts = new ImageOrPrintOptions();
opts.setOnePagePerSheet(true);
opts.setOnlyArea(true);
opts.setChartImageType(ImageFormat.getTiff());
opts.setHorizontalResolution(150);
opts.setVerticalResolution(150);

there are no problem, but using

ImageOrPrintOptions opts = new ImageOrPrintOptions();
opts.setImageType(ImageType.TIFF);
opts.setOnePagePerSheet(true);
opts.setOnlyArea(true);
opts.setHorizontalResolution(150);
opts.setVerticalResolution(150);

the problem occurs.

This property “opts.setChartImageType(ImageFormat.getTiff());” is deprecated but into the documentation there is not written what we can use in the place of it.

We attach a test that reproduce the problem.

Could you help us to understand how we can solve the problem, please?
Thanks,
Giulio

charttoimage.zip (17.5 KB)

@giulio.andolfi,

Thanks for the template Excel file and details.

After initial test, I was able to reproduce the issue as you mentioned by using your template Excel file and sample code. I found that Chart.toImage(…) returns “java.lang.Exception: Image format(TIFF) is not supported” error. It works fine for other image formats though.

We require thorough evaluation of the issue. We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSJAVA-45845

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.

Hello @amjad.sahi ,
thank you to have opened the issue CELLSJAVA-45845.
I have access to the Paid Support Service but at the moment there are not need of High priority.
Let me know if there are news, please.
Many thanks.
Giulio

@giulio.andolfi
You are welcome. We will notify you immediately of any updates.

@giulio.andolfi,

This is to inform inform you that your issue (logged earlier as “CELLSJAVA-45845”) has been resolved now. The fix will be included in the upcoming release (Aspose.Cells v24.3) that we plan to release in the first half of March (next month). You will be notified when the next version is released.

This is a good news.
Many thanks,
Giulio

@giulio.andolfi,

You are welcome.

The issues you have found earlier (filed as CELLSJAVA-45845) have been fixed in Aspose.Cells for Java 24.3.