Uploaded image for project: 'Commons Imaging'
  1. Commons Imaging
  2. IMAGING-136

Imaging.getImageInfo() fails to read JPEG file

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Reopened
    • Major
    • Resolution: Unresolved
    • 1.0-alpha1
    • 1.0-alpha2
    • Format: JPEG
    • None

    Description

      I get this with the attached file:

      Exception in thread "main" java.io.IOException: Could not read block (block start: 20274, block length: 24267, data length: 7789).
      	at org.apache.commons.imaging.common.bytesource.ByteSourceArray.getBlock(ByteSourceArray.java:47)
      	at org.apache.commons.imaging.formats.tiff.TiffReader.getTiffRawImageData(TiffReader.java:445)
      	at org.apache.commons.imaging.formats.tiff.TiffReader.readDirectory(TiffReader.java:222)
      	at org.apache.commons.imaging.formats.tiff.TiffReader.readDirectory(TiffReader.java:120)
      	at org.apache.commons.imaging.formats.tiff.TiffReader.readDirectories(TiffReader.java:113)
      	at org.apache.commons.imaging.formats.tiff.TiffReader.read(TiffReader.java:425)
      	at org.apache.commons.imaging.formats.tiff.TiffReader.readContents(TiffReader.java:417)
      	at org.apache.commons.imaging.formats.tiff.TiffImageParser.getMetadata(TiffImageParser.java:123)
      	at org.apache.commons.imaging.ImageParser.getMetadata(ImageParser.java:220)
      	at org.apache.commons.imaging.formats.jpeg.JpegImageParser.getExifMetadata(JpegImageParser.java:355)
      	at org.apache.commons.imaging.formats.jpeg.JpegImageParser.getMetadata(JpegImageParser.java:312)
      	at org.apache.commons.imaging.formats.jpeg.JpegImageParser.getImageInfo(JpegImageParser.java:725)
      	at org.apache.commons.imaging.Imaging.getImageInfo(Imaging.java:704)
      	at org.apache.commons.imaging.Imaging.getImageInfo(Imaging.java:678)
      	at org.apache.commons.imaging.Imaging.getImageInfo(Imaging.java:697)
      	at com.mycompany.apacheimagingtest.App.main(App.java:17)
      

      I don't need any EXIF data, so it would be nice to have a workaround that just gets me the basic information about the image, i.e. size, bits, and color type (ycck, cmyk).

      Attachments

        1. 1402522741337.jpg
          771 kB
          Tilman Hausherr

        Issue Links

          Activity

            People

              kinow Bruno P. Kinoshita
              tilman Tilman Hausherr
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: