mirror of
https://github.com/status-im/nimPNG.git
synced 2025-01-14 22:54:09 +00:00
fixes #9
This commit is contained in:
parent
3cb3284c2d
commit
dd5868ddd3
@ -410,7 +410,7 @@ proc readInt16(s: var BitStream): int =
|
|||||||
#go to first boundary of byte
|
#go to first boundary of byte
|
||||||
while (s.bitpointer and 0x7) != 0: inc s.bitpointer
|
while (s.bitpointer and 0x7) != 0: inc s.bitpointer
|
||||||
var p = s.bitpointer div 8 #byte position
|
var p = s.bitpointer div 8 #byte position
|
||||||
if p + 2 >= s.data.len: raise newNZError("bit pointer will jump past memory")
|
if p + 2 > s.data.len: raise newNZError("bit pointer will jump past memory")
|
||||||
result = ord(s.data[p]) + 256 * ord(s.data[p + 1])
|
result = ord(s.data[p]) + 256 * ord(s.data[p + 1])
|
||||||
inc(s.bitpointer, 16)
|
inc(s.bitpointer, 16)
|
||||||
|
|
||||||
|
BIN
tester/sample.png
Normal file
BIN
tester/sample.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.4 MiB |
3
tester/test.nim
Normal file
3
tester/test.nim
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
import nimPNG
|
||||||
|
let data = loadPNG32("sample.png")
|
||||||
|
assert(not data.isNil)
|
Loading…
x
Reference in New Issue
Block a user