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

Imaging.getImageInfo() fails to read JPEG file

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            kinow Bruno P. Kinoshita
            tilman Tilman Hausherr

            Dates

              Created:
              Updated:

              Slack

                Issue deployment