Uploaded image for project: 'Keikai'
  1. Keikai
  2. KEIKAI-636

an external image fails the importing

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 6.0.0
    • None
    • None
    • Security Level: Jimmy
    • None
    • None

      Steps to Reproduce

      1. import keikai-636.xlsx

      Current Result

      java.lang.NullPointerException
      io.keikai.model.SPicture$Format.valueOfFileExtension(SPicture.java:45)
      io.keikai.importer.XlsxImporter.importPicture(XlsxImporter.java:1106)
      io.keikai.importer.XlsxImporter.importDrawings(XlsxImporter.java:1028)
      io.keikai.importer.XlsxImporter.imports(XlsxImporter.java:326)
      io.keikai.range.impl.imexp.ExcelImportAdapter.imports(ExcelImportAdapter.java:48)
      io.keikai.range.impl.imexp.AbstractImporter.imports(AbstractImporter.java:57)
      io.keikai.ui.Spreadsheet.getSBook(Spreadsheet.java:725)
      io.keikai.ui.Spreadsheet.getSelectedSSheet(Spreadsheet.java:905)
      io.keikai.ui.Spreadsheet.doInvalidate(Spreadsheet.java:2779)
      io.keikai.ui.Spreadsheet.invalidate(Spreadsheet.java:2632)
      io.keikai.ui.Spreadsheet.setSrc(Spreadsheet.java:972)

      Expected Result

      • no exception
      • print a warning message: ignore an external image at [SHEET!CELL_ADDRESS]
      • still render the file content

      Debug Information

      • the file contains an external image. Sine keikai cannot render that image, it's better to ignore it and render the content without an exception.
      • Check keikai-636.xlsx/xl/drawings/_rels/drawing1.xml.rels, you will find:
      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
          <Relationship Id="rId3"
              Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"
              Target="../media/image2.png" />
          <Relationship Id="rId2"
              Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"
              Target="cid:[email protected]" TargetMode="External" />
          <Relationship Id="rId1"
              Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"
              Target="../media/image1.jpeg" />
          <Relationship Id="rId4"
              Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"
              Target="../media/image3.png" />
      </Relationships>
      

      Workaround

      • remove the external image or turn it into an internal image

            DevChu DevChu
            hawk hawk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: