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

Free Support Forum - aspose.com

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());
wb.save(“C:/SmartbiSpreadSheetReport/GIF.html”, o);

o.getImageOptions().setImageFormat(ImageFormat.getIcon());
o.getImageOptions().setSaveFormat(SaveFormat.SVG);
wb.save(“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

Hi,


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
e.g
Sample code:

License lics = new License();
lics.setLicense(“Aspose.Total.Java.lic”);
Workbook wb = new Workbook(“GIF.xlsx”);
HtmlSaveOptions o = new HtmlSaveOptions();
o.setExportActiveWorksheetOnly(true);
o.getImageOptions().setImageFormat(ImageFormat.getPng());
wb.save(“f:/files/GIF1.html”, o); //Ok
o.getImageOptions().setImageFormat(ImageFormat.getIcon());
o.getImageOptions().setSaveFormat(SaveFormat.SVG);
wb.save(“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.

@xhaixia,
The issue is fixed in v21.6.2.
aspose-cells-21.6.2-java.zip (7.3 MB)