The method getPictures of the Worksheet returned 14,404 image objects, but there are definitely not that many images in my Excel document

NoPictures.zip (590.3 KB)

<dependency>
            <groupId>com.aspose</groupId>
            <artifactId>aspose-cells</artifactId>
            <version>21.1</version>
        </dependency>
@Test
    void readPictures() throws Exception {
        Workbook workbook = new Workbook(srcDir+ "NoPictures.xlsx");

        WorksheetCollection worksheets = workbook.getWorksheets();
        Worksheet sourceSheet = worksheets.get(0);
        Assertions.assertTrue(sourceSheet.getPictures().getCount()==14404);
    }

Please review the attachment I uploaded; it does not contain many files.

@gulixiang,

I tested your scenario/case using your Excel XLSX file and found the first worksheet has 14404 pictures and rightly so. Then, I confirmed by opening your file into MS Excel manually. I selected/clicked the first worksheet in the workbook. Then, I clicked “Find & Select” dropdown menu to select “Selection Pane” option. I found there are many images and these are hidden, so you may make them visible/display to spot them. See the screenshot attached.
sc_shot1.png (122.1 KB)

In short, Aspose.Cells is giving pictures count right.

Let us know if you still have any confusion or issue?

Indeed, there are that many pictures, but they are not visible. Thank you, I will look into why so many image data were generated.

@gulixiang,

Great, and it’s good to know that you found those pictures in the worksheet. Please feel free to write back to us if you have any further queries or comments.