2022-07-09 18:08:34 +00:00
|
|
|
import pixie, pixie/fileformats/gif, xrays
|
2021-03-01 09:01:04 +00:00
|
|
|
|
2022-06-09 00:53:22 +00:00
|
|
|
block:
|
|
|
|
let
|
|
|
|
path = "tests/fileformats/gif/3x5.gif"
|
2022-06-14 02:47:39 +00:00
|
|
|
image = readImage(path)
|
2022-06-09 00:53:22 +00:00
|
|
|
dimensions = decodeGifDimensions(readFile(path))
|
2022-07-09 18:08:34 +00:00
|
|
|
image.xray("tests/fileformats/gif/3x5.png")
|
2022-06-09 00:53:22 +00:00
|
|
|
doAssert image.width == dimensions.width
|
|
|
|
doAssert image.height == dimensions.height
|
2021-03-01 09:01:04 +00:00
|
|
|
|
2022-06-09 00:53:22 +00:00
|
|
|
block:
|
|
|
|
let
|
|
|
|
path = "tests/fileformats/gif/audrey.gif"
|
2022-06-14 02:47:39 +00:00
|
|
|
image = readImage(path)
|
2022-06-09 00:53:22 +00:00
|
|
|
dimensions = decodeGifDimensions(readFile(path))
|
2022-07-09 18:08:34 +00:00
|
|
|
image.xray("tests/fileformats/gif/audrey.png")
|
2022-06-09 00:53:22 +00:00
|
|
|
doAssert image.width == dimensions.width
|
|
|
|
doAssert image.height == dimensions.height
|
2021-03-01 09:01:04 +00:00
|
|
|
|
2022-06-09 00:53:22 +00:00
|
|
|
block:
|
|
|
|
let
|
|
|
|
path = "tests/fileformats/gif/sunflower.gif"
|
2022-06-14 02:47:39 +00:00
|
|
|
image = readImage(path)
|
2022-06-09 00:53:22 +00:00
|
|
|
dimensions = decodeGifDimensions(readFile(path))
|
2022-07-09 18:08:34 +00:00
|
|
|
image.xray("tests/fileformats/gif/sunflower.png")
|
2022-06-09 00:53:22 +00:00
|
|
|
doAssert image.width == dimensions.width
|
|
|
|
doAssert image.height == dimensions.height
|
2021-03-01 16:53:15 +00:00
|
|
|
|
2022-06-09 00:53:22 +00:00
|
|
|
block:
|
|
|
|
let
|
|
|
|
path = "tests/fileformats/gif/sunflower.gif"
|
2022-06-14 02:47:39 +00:00
|
|
|
image = readImage(path)
|
2022-06-09 00:53:22 +00:00
|
|
|
dimensions = decodeGifDimensions(readFile(path))
|
2022-07-09 18:08:34 +00:00
|
|
|
image.xray("tests/fileformats/gif/sunflower.png")
|
2022-06-09 00:53:22 +00:00
|
|
|
doAssert image.width == dimensions.width
|
|
|
|
doAssert image.height == dimensions.height
|
2022-06-14 02:47:39 +00:00
|
|
|
|
|
|
|
block:
|
|
|
|
let img4 = readImage("tests/fileformats/gif/newtons_cradle.gif")
|
2022-07-09 18:08:34 +00:00
|
|
|
img4.xray("tests/fileformats/gif/newtons_cradle.png")
|
2022-06-14 02:47:39 +00:00
|
|
|
|
|
|
|
let animatedGif =
|
|
|
|
decodeGif(readFile("tests/fileformats/gif/newtons_cradle.gif"))
|
|
|
|
doAssert animatedGif.frames.len == 36
|
|
|
|
doAssert animatedGif.intervals.len == animatedGif.frames.len
|