Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
LazySegmentBytes fix: always read bytes at the offset #2063
The problem here was that we were using the same ByteReader extension method that we use for TiffTag reading to read the segment bytes. The TiffTag bytes have a property that if the length is less than 4 bytes, the value is stored inside the offset field. This property does not apply to segment bytes, so I refactored LazySegmentBytes so that it uses it's own straightforward byte reading code. ArraySegmentBytes delegates to LazySegmentBytes, so this fixes both streaming and non-streaming cases.