mirror of https://github.com/status-im/nimPNG.git
update tester
This commit is contained in:
parent
8e492e0f90
commit
357be6f26a
|
@ -45,3 +45,4 @@ Temporary Items
|
|||
*.exe
|
||||
nimcache
|
||||
bug
|
||||
tester/temp.png
|
|
@ -2412,7 +2412,7 @@ proc filterScanLine(output: var cstring, scanLine, prevLine: cstring, len, byteW
|
|||
for i in byteWidth..len-1:
|
||||
output[i] = chr(scanLine[i].uint - scanLine[i - byteWidth].uint)
|
||||
else:
|
||||
raise PNGError("unsupported fitler type")
|
||||
raise PNGError("unsupported filter type")
|
||||
|
||||
proc filterZero(output: var cstring, input: cstring, w, h, bpp: int) =
|
||||
#the width of a scanline in bytes, not including the filter type
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import nimPNG, streams, math, strutils, tables, base64
|
||||
import nimPNG, streams, math, strutils, tables, base64, os
|
||||
|
||||
type
|
||||
Image = ref object
|
||||
|
@ -979,6 +979,17 @@ proc testAutoColorModels() =
|
|||
addColor16(alpha16, 257, 0, 0, 10000)
|
||||
testAutoColorModel(alpha16, 16, LCT_RGBA, 16, false)
|
||||
|
||||
proc testFilter() =
|
||||
echo "test Filter"
|
||||
let input = "tester" & DirSep & "tfilter.png"
|
||||
let temp = "tester" & DirSep & "temp.png"
|
||||
let png = loadPNG32(input)
|
||||
discard savePNG32(temp, png.data, png.width, png.height)
|
||||
let png2 = loadPNG32(temp)
|
||||
if png.data != png2.data:
|
||||
echo "testFilter failed"
|
||||
quit()
|
||||
|
||||
proc doMain() =
|
||||
testPNGCodec()
|
||||
testPngSuiteTiny()
|
||||
|
@ -990,8 +1001,9 @@ proc doMain() =
|
|||
testColorConvert2()
|
||||
testPaletteToPaletteConvert()
|
||||
testRGBToPaletteConvert()
|
||||
test16bitColorEndianness();
|
||||
testNoAutoConvert();
|
||||
testAutoColorModels();
|
||||
test16bitColorEndianness()
|
||||
testNoAutoConvert()
|
||||
testAutoColorModels()
|
||||
testFilter()
|
||||
|
||||
doMain()
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 94 KiB |
Loading…
Reference in New Issue