mirror of https://github.com/status-im/nimPNG.git
commit
a961150d81
|
@ -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)
|
||||||
|
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 2.4 MiB |
|
@ -0,0 +1,3 @@
|
||||||
|
import nimPNG
|
||||||
|
let data = loadPNG32("sample.png")
|
||||||
|
assert(not data.isNil)
|
Loading…
Reference in New Issue