Skip to content

LazySegmentBytes fix: always read bytes at the offset - #2063

Merged
lossyrob merged 1 commit into
locationtech:masterfrom
lossyrob:fix/small-geotiff-write
Mar 14, 2017
Merged

lossyrob merged 1 commit into
locationtech:masterfrom
lossyrob:fix/small-geotiff-write

Conversation

@lossyrob

Copy link
Copy Markdown
Member

Fixes #1959

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.

@lossyrob lossyrob added this to the 1.1 milestone Mar 14, 2017
@lossyrob
lossyrob merged commit e21f88e into locationtech:master Mar 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GeotiffReader decodes wrong value

2 participants