mirror of https://github.com/status-im/nimPNG.git
fix testCodec
This commit is contained in:
parent
b69b705a34
commit
63bbcb7643
|
@ -254,10 +254,10 @@ proc makeChunkType*(val: string): PNGChunkType =
|
||||||
proc `$`*(tag: PNGChunkType): string =
|
proc `$`*(tag: PNGChunkType): string =
|
||||||
result = newString(4)
|
result = newString(4)
|
||||||
let t = int(tag)
|
let t = int(tag)
|
||||||
result[0] = chr(toU32(t shr 24) and 0xFF)
|
result[0] = chr(uint32(t shr 24) and 0xFF)
|
||||||
result[1] = chr(toU32(t shr 16) and 0xFF)
|
result[1] = chr(uint32(t shr 16) and 0xFF)
|
||||||
result[2] = chr(toU32(t shr 8) and 0xFF)
|
result[2] = chr(uint32(t shr 8) and 0xFF)
|
||||||
result[3] = chr(toU32(t) and 0xFF)
|
result[3] = chr(uint32(t) and 0xFF)
|
||||||
|
|
||||||
proc `==`(a, b: PNGChunkType): bool = int(a) == int(b)
|
proc `==`(a, b: PNGChunkType): bool = int(a) == int(b)
|
||||||
#proc isAncillary(a: PNGChunkType): bool = (int(a) and (32 shl 24)) != 0
|
#proc isAncillary(a: PNGChunkType): bool = (int(a) and (32 shl 24)) != 0
|
||||||
|
|
|
@ -24,7 +24,6 @@ proc getNumColorChannels(colorType: PNGcolorType): int =
|
||||||
of LCT_PALETTE: result = 1
|
of LCT_PALETTE: result = 1
|
||||||
of LCT_GREY_ALPHA: result = 2
|
of LCT_GREY_ALPHA: result = 2
|
||||||
of LCT_RGBA: result = 4
|
of LCT_RGBA: result = 4
|
||||||
else: result = 0
|
|
||||||
|
|
||||||
proc generateTestImage(width, height: int, colorType = LCT_RGBA, bitDepth = 8): Image =
|
proc generateTestImage(width, height: int, colorType = LCT_RGBA, bitDepth = 8): Image =
|
||||||
new(result)
|
new(result)
|
||||||
|
|
Loading…
Reference in New Issue