Uploaded image for project: 'Batik'
  1. Batik
  2. BATIK-1150

ArrayIndexOutOfBoundsException when referencing PNG with 8-bit color

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Cannot Reproduce
    • 1.8
    • None
    • SVG Rasterizer
    • None

    Description

      I have an SVG which references a PNG which has an 8-bit color space (only one band).
      Rendering the SVG using Batik 1.8 fails with an exception like:

      java.lang.ArrayIndexOutOfBoundsException: 405
      	at java.awt.image.SinglePixelPackedSampleModel.setPixels(SinglePixelPackedSampleModel.java:671)
      	at java.awt.image.WritableRaster.setPixels(WritableRaster.java:550)
      	at sun.awt.image.SunWritableRaster.setPixels(SunWritableRaster.java:176)
      	at org.apache.batik.ext.awt.image.GraphicsUtil.copyData_FALLBACK(GraphicsUtil.java:838)
      	at org.apache.batik.ext.awt.image.GraphicsUtil.copyData(GraphicsUtil.java:857)
      	at org.apache.batik.ext.awt.image.rendered.Any2sRGBRed.copyData(Any2sRGBRed.java:261)
      	at org.apache.batik.ext.awt.image.rendered.FormatRed.copyData(Unknown Source)
      	at org.apache.batik.ext.awt.image.rendered.AbstractRed.getData(AbstractRed.java:530)
      	at org.apache.batik.ext.awt.image.rendered.AbstractRed.getData(AbstractRed.java:515)
      	at org.apache.batik.ext.awt.image.codec.imageio.AbstractImageIORegistryEntry$1.run(AbstractImageIORegistryEntry.java:142)

      I'm attaching the SVG and PNG

      Attachments

        1. small_panel.svg
          0.7 kB
          Radu Coravu
        2. test.png
          21 kB
          Radu Coravu

        Activity

          People

            Unassigned Unassigned
            radu_coravu Radu Coravu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 3h
                3h
                Remaining:
                Remaining Estimate - 3h
                3h
                Logged:
                Time Spent - Not Specified
                Not Specified