Daniel-Glucksman / JBig2Decoder.NET

A .Net Implementation of the JPedal JBig2 Decoder
MIT License
10 stars 4 forks source link

NullReferenceException #5

Open wstaelens opened 6 years ago

wstaelens commented 6 years ago

when opening a pdf file with JBIG2 image:

System.NullReferenceException occurred
  HResult=0x80004003
  Message=Object reference not set to an instance of an object.
  Source=JBig2Decoder
  StackTrace:
   at JBig2Decoder.TextRegionSegment.readSegment()
   at JBig2Decoder.JBIG2StreamDecoder.readSegments()
   at JBig2Decoder.JBIG2StreamDecoder.decodeJBIG2(Byte[] data, ImageFormat format, Int32 NewWidth, Int32 NewHeight)

according to this https://issues.apache.org/jira/browse/PDFBOX-1067 it has something to do with JBIG2Globals.

the pdf attached to this issue is somehow special. It's datastream is somehow splitted, it contains a global segment (JBIG2Globals) I didn't understand yet what that really means ... There's a comment here about dealing with embedded data, where JBIG2Globals are separate: http://code.google.com/p/jbig2-imageio/wiki/Usage here that Does that help?

attached are some files from the ticket: https://issues.apache.org/jira/browse/PDFBOX-1067

ItDoesntWorkScan.jbig2.zip

ItDoesntWorkScan.pdf

sakelley_pdf_rendering_problem.zip

wstaelens commented 6 years ago

same issue with file: https://issues.apache.org/jira/secure/attachment/12865265/jbig2.pdf

TonyWoo commented 6 years ago

I just see same issue, can you help take a look this issue? thanks.

wstaelens commented 6 years ago

well it is a nullreferenceexception, can be fixed easily but you need to know the root cause. Hope the developer reads this?