Picture is added in MS Excel worksheet wrongly in Java

Workbook wb = new Workbook("C:/BIAS.xlsx");

PictureCollection pictures = wb.getWorksheets().get(0).getPictures();

pictures.add(2, 2, new FileInputStream("C:/co.png"));

wb.save("C:/BIAS2.xlsx");

I use 8.8.1.0


The result xlsx file's picture display wrong.

It work well in 8.5.2.3

Hi,


Thanks for providing us template file and sample code.

Please try our latest version/fix: Aspose.Cells for Java v8.8.2:

I have tested your scenario/ case a bit using your template file and sample code, it works fine. I do not spot any issue with the picture in the output Excel file (attached).
e.g
Sample code:

Workbook wb = new Workbook(“BIAS.xlsx”);
PictureCollection pictures = wb.getWorksheets().get(0).getPictures();
pictures.add(2, 2, new FileInputStream(“f:/files/co.png”));
wb.save(“out1.xlsx”);

Could you open the attached output file and check if you still have any issue with the inserted picture. If you find any issue, kindly do highlight in a screen shot with details, we will check it soon.

Thank you.