Merge pull request #5 from yglukhov/patch-1

Optimised png decoding
This commit is contained in:
andri lim 2016-08-12 22:21:54 +07:00 committed by GitHub
commit d21b7035bf
1 changed files with 2 additions and 2 deletions

View File

@ -1221,8 +1221,8 @@ proc nzDeflateInit*(input: string): nzStream =
proc nzInflateInit*(input: string): nzStream =
var nz = nzInit()
nz.data = ""
nz.bits.data = input
nz.data = newStringOfCap(1024 * 1024 * 5) # Allocate 5MB in advance
shallowCopy(nz.bits.data, input)
nz.bits.bitpointer = 0
nz.bits.databitlen = input.len * 8
nz.mode = nzsInflate