Convert excel contains GIF picture wrong

Workbook wb = new Workbook("C:/SmartbiSpreadSheetReport/GIF.xlsx"); HtmlSaveOptions o = new HtmlSaveOptions(); o.setExportActiveWorksheetOnly(true);

o.getImageOptions().setImageFormat(ImageFormat.getPng());“C:/SmartbiSpreadSheetReport/GIF.html”, o);

o.getImageOptions().setSaveFormat(SaveFormat.SVG);“C:/SmartbiSpreadSheetReport/GIF2.html”, o);

Image in GIF1.html is gif and animate

Image in GIF2.html is SVG with data:image/png;base64, but not data:image/gif;base64, and not animate


Thanks for providing us template file and sample code with details.

After an initial test, I observed the issue as you mentioned by using the following sample code with your template file. I found that converting your template Excel file (containing GIF image) to HTML is wrong when we save it with SVG format as per the code segment for the second conversion.
1) Image in the output GIF1.html is gif and animated. - Ok
2) Image in GIF2.html is SVG with “data:image/png;base64”, where it should have been “data:image/gif;base64” as per source code of .svg file. Also, it is not animated. - Not Ok
Sample code:

License lics = new License();
Workbook wb = new Workbook(“GIF.xlsx”);
HtmlSaveOptions o = new HtmlSaveOptions();
o.getImageOptions().setImageFormat(ImageFormat.getPng());“f:/files/GIF1.html”, o); //Ok
o.getImageOptions().setSaveFormat(SaveFormat.SVG);“f:/files/GIF2.html”, o);//Not Ok

I have logged a ticket with an id “CELLSJAVA-41842” for your issue. We will look into it soon.

Once we have an update on your issue, we will let you know here.

Thank you.

The issue is fixed in v21.6.2. (7.3 MB)