diff --git a/src/pixie/masks.nim b/src/pixie/masks.nim index 847f4d4..9eafd92 100644 --- a/src/pixie/masks.nim +++ b/src/pixie/masks.nim @@ -153,6 +153,22 @@ proc minifyBy2*(mask: Mask, power = 1): Mask {.raises: [PixieError].} = # Set src as this result for if we do another power src = result +proc magnifyBy2*(mask: Mask, power = 1): Mask {.raises: [PixieError].} = + ## Scales mask up by 2 ^ power. + if power < 0: + raise newException(PixieError, "Cannot magnifyBy2 with negative power") + + let scale = 2 ^ power + result = newMask(mask.width * scale, mask.height * scale) + for y in 0 ..< result.height: + for x in 0 ..< mask.width: + let + value = mask.getValueUnsafe(x, y div scale) + scaledX = x * scale + idx = result.dataIndex(scaledX, y) + for i in 0 ..< scale: + result.data[idx + i] = value + proc fillUnsafe*( data: var seq[uint8], value: uint8, start, len: int ) {.raises: [].} = diff --git a/tests/benchmark_blends.nim b/tests/benchmark_blends.nim index a1e25fc..2052f85 100644 --- a/tests/benchmark_blends.nim +++ b/tests/benchmark_blends.nim @@ -28,11 +28,11 @@ timeIt "blendMultiply": for i in 0 ..< backdrop.data.len: backdrop.data[i] = blendMultiply(backdrop.data[i], source.data[i]) -reset() +# reset() -timeIt "blendLinearBurn": - for i in 0 ..< backdrop.data.len: - backdrop.data[i] = blendLinearBurn(backdrop.data[i], source.data[i]) +# timeIt "blendLinearBurn": +# for i in 0 ..< backdrop.data.len: +# backdrop.data[i] = blendLinearBurn(backdrop.data[i], source.data[i]) reset() @@ -52,11 +52,11 @@ timeIt "blendScreen": for i in 0 ..< backdrop.data.len: backdrop.data[i] = blendScreen(backdrop.data[i], source.data[i]) -reset() +# reset() -timeIt "blendLinearDodge": - for i in 0 ..< backdrop.data.len: - backdrop.data[i] = blendLinearDodge(backdrop.data[i], source.data[i]) +# timeIt "blendLinearDodge": +# for i in 0 ..< backdrop.data.len: +# backdrop.data[i] = blendLinearDodge(backdrop.data[i], source.data[i]) reset() @@ -132,12 +132,6 @@ timeIt "blendSubtractMask": reset() -timeIt "blendIntersectMask": - for i in 0 ..< backdrop.data.len: - backdrop.data[i] = blendIntersectMask(backdrop.data[i], source.data[i]) - -reset() - timeIt "blendExcludeMask": for i in 0 ..< backdrop.data.len: backdrop.data[i] = blendExcludeMask(backdrop.data[i], source.data[i]) diff --git a/tests/benchmark_drawCorrect_vs_drawUber.nim b/tests/benchmark_drawCorrect_vs_drawUber.nim index b8108c8..2cd166d 100644 --- a/tests/benchmark_drawCorrect_vs_drawUber.nim +++ b/tests/benchmark_drawCorrect_vs_drawUber.nim @@ -10,7 +10,7 @@ block: b.fill(rgba(0, 255, 0, 255)) timeIt "drawCorrect small-on-big": - a.drawCorrect(b, translate(vec2(25, 25)), bmNormal) + a.drawCorrect(b, translate(vec2(25, 25)), blendMode = bmNormal) keep(b) block: @@ -21,7 +21,7 @@ block: b.fill(rgba(0, 255, 0, 255)) timeIt "drawUber small-on-big": - a.drawUber(b, translate(vec2(25, 25)), bmNormal) + a.drawUber(b, translate(vec2(25, 25)), blendMode = bmNormal) keep(b) block: @@ -32,7 +32,7 @@ block: b.fill(rgba(0, 255, 0, 255)) timeIt "drawCorrect small-on-big smooth": - a.drawCorrect(b, translate(vec2(25.1, 25.1)), bmNormal) + a.drawCorrect(b, translate(vec2(25.1, 25.1)), blendMode = bmNormal) keep(b) block: @@ -43,5 +43,5 @@ block: b.fill(rgba(0, 255, 0, 255)) timeIt "drawUber small-on-big smooth": - a.drawUber(b, translate(vec2(25.1, 25.1)), bmNormal) + a.drawUber(b, translate(vec2(25.1, 25.1)), blendMode = bmNormal) keep(b) diff --git a/tests/benchmark_fonts.nim b/tests/benchmark_fonts.nim index 301b3b8..429bbf7 100644 --- a/tests/benchmark_fonts.nim +++ b/tests/benchmark_fonts.nim @@ -7,13 +7,13 @@ font.size = 16 let image = newImage(500, 300) - mask = newMask(500, 300) + # mask = newMask(500, 300) timeIt "typeset": - discard font.typeset(text, bounds = image.wh) + discard font.typeset(text, bounds = vec2(image.width.float32, 0)) timeIt "rasterize": image.fill(rgba(255, 255, 255, 255)) - image.fillText(font, text, bounds = image.wh) + image.fillText(font, text, bounds = vec2(image.width.float32, 0)) # mask.fill(0) # mask.fillText(font, text, bounds = mask.wh) diff --git a/tests/benchmark_gif.nim b/tests/benchmark_gif.nim index ae02f7d..78bc373 100644 --- a/tests/benchmark_gif.nim +++ b/tests/benchmark_gif.nim @@ -1,6 +1,6 @@ import benchy, pixie/fileformats/gif -let data = readFile("tests/images/gif/audrey.gif") +let data = readFile("tests/fileformats/gif/audrey.gif") timeIt "pixie decode": keep decodeGif(data) diff --git a/tests/benchmark_images.nim b/tests/benchmark_images.nim index 428fbd0..d0955ac 100644 --- a/tests/benchmark_images.nim +++ b/tests/benchmark_images.nim @@ -70,7 +70,7 @@ timeIt "toStraightAlpha": reset() block: - var path: Path + let path = newPath() path.ellipse(image.width / 2, image.height / 2, 300, 300) let mask = newMask(image.width, image.height) diff --git a/tests/benchmark_images_blur.nim b/tests/benchmark_images_blur.nim index 0007474..f04d215 100644 --- a/tests/benchmark_images_blur.nim +++ b/tests/benchmark_images_blur.nim @@ -68,7 +68,7 @@ proc blurSlower*( let image = newImage(1920, 1080) proc reset() = - var path: Path + let path = newPath() path.rect(100, 100, 1720, 880) image.fillPath(path, rgba(255, 255, 255, 255)) diff --git a/tests/benchmark_jpg.nim b/tests/benchmark_jpg.nim index 6420e2a..4a68227 100644 --- a/tests/benchmark_jpg.nim +++ b/tests/benchmark_jpg.nim @@ -1,6 +1,6 @@ import benchy, pixie/fileformats/jpg -let data = readFile("tests/images/jpg/jpeg420exif.jpg") +let data = readFile("tests/fileformats/jpg/jpeg420exif.jpg") timeIt "pixie decode": discard decodeJpg(cast[seq[uint8]](data)) diff --git a/tests/benchmark_masks.nim b/tests/benchmark_masks.nim index 5c0a550..57c6a23 100644 --- a/tests/benchmark_masks.nim +++ b/tests/benchmark_masks.nim @@ -34,7 +34,7 @@ timeIt "ceil": reset() block spread_1: - var p: Path + let p = newPath() p.rect(500, 500, 500, 500) timeIt "spread_1": @@ -43,7 +43,7 @@ block spread_1: mask.spread(10) block spread_2: - var p: Path + let p = newPath() p.rect(500, 500, 1000, 1000) timeIt "spread_2": diff --git a/tests/benchmark_paths.nim b/tests/benchmark_paths.nim index 98e9072..080d76e 100644 --- a/tests/benchmark_paths.nim +++ b/tests/benchmark_paths.nim @@ -11,7 +11,7 @@ image.fill(rgba(255, 255, 255, 255)) timeIt "roundedRect": const radius = 20 - var path: Path + let path = newPath() path.roundedRect(0.5, 0.5, 499, 299, radius, radius, radius, radius) # path.roundedRect(0, 0, 500, 300, radius, radius, radius, radius) diff --git a/tests/benchmark_png.nim b/tests/benchmark_png.nim index 137977d..29ad32a 100644 --- a/tests/benchmark_png.nim +++ b/tests/benchmark_png.nim @@ -2,7 +2,7 @@ import benchy, cairo, nimPNG, pixie/fileformats/png, stb_image/read as stbi, stb_image/write as stbr let - filePath = "tests/images/png/lenna.png" + filePath = "tests/fileformats/png/lenna.png" data = readFile(filePath) timeIt "pixie decode": diff --git a/tests/benchmark_svg.nim b/tests/benchmark_svg.nim index e36e3a6..a17351d 100644 --- a/tests/benchmark_svg.nim +++ b/tests/benchmark_svg.nim @@ -1,6 +1,6 @@ import benchy, pixie/fileformats/svg -let data = readFile("tests/images/svg/Ghostscript_Tiger.svg") +let data = readFile("tests/fileformats/svg/Ghostscript_Tiger.svg") timeIt "svg decode": keep decodeSvg(data) diff --git a/tests/images/context/beginPath_1.png b/tests/contexts/beginPath_1.png similarity index 100% rename from tests/images/context/beginPath_1.png rename to tests/contexts/beginPath_1.png diff --git a/tests/images/context/bezierCurveTo_1.png b/tests/contexts/bezierCurveTo_1.png similarity index 100% rename from tests/images/context/bezierCurveTo_1.png rename to tests/contexts/bezierCurveTo_1.png diff --git a/tests/images/context/bezierCurveTo_2.png b/tests/contexts/bezierCurveTo_2.png similarity index 100% rename from tests/images/context/bezierCurveTo_2.png rename to tests/contexts/bezierCurveTo_2.png diff --git a/tests/images/context/blendmode_1.png b/tests/contexts/blendmode_1.png similarity index 100% rename from tests/images/context/blendmode_1.png rename to tests/contexts/blendmode_1.png diff --git a/tests/images/context/clearRect_1.png b/tests/contexts/clearRect_1.png similarity index 100% rename from tests/images/context/clearRect_1.png rename to tests/contexts/clearRect_1.png diff --git a/tests/images/context/clip_1.png b/tests/contexts/clip_1.png similarity index 100% rename from tests/images/context/clip_1.png rename to tests/contexts/clip_1.png diff --git a/tests/images/context/clip_1b.png b/tests/contexts/clip_1b.png similarity index 100% rename from tests/images/context/clip_1b.png rename to tests/contexts/clip_1b.png diff --git a/tests/images/context/clip_1c.png b/tests/contexts/clip_1c.png similarity index 100% rename from tests/images/context/clip_1c.png rename to tests/contexts/clip_1c.png diff --git a/tests/images/context/clip_1d.png b/tests/contexts/clip_1d.png similarity index 100% rename from tests/images/context/clip_1d.png rename to tests/contexts/clip_1d.png diff --git a/tests/images/context/clip_1e.png b/tests/contexts/clip_1e.png similarity index 100% rename from tests/images/context/clip_1e.png rename to tests/contexts/clip_1e.png diff --git a/tests/images/context/clip_1f.png b/tests/contexts/clip_1f.png similarity index 100% rename from tests/images/context/clip_1f.png rename to tests/contexts/clip_1f.png diff --git a/tests/images/context/clip_2.png b/tests/contexts/clip_2.png similarity index 100% rename from tests/images/context/clip_2.png rename to tests/contexts/clip_2.png diff --git a/tests/images/context/clip_3.png b/tests/contexts/clip_3.png similarity index 100% rename from tests/images/context/clip_3.png rename to tests/contexts/clip_3.png diff --git a/tests/images/context/clip_text.png b/tests/contexts/clip_text.png similarity index 100% rename from tests/images/context/clip_text.png rename to tests/contexts/clip_text.png diff --git a/tests/images/context/closePath_1.png b/tests/contexts/closePath_1.png similarity index 100% rename from tests/images/context/closePath_1.png rename to tests/contexts/closePath_1.png diff --git a/tests/images/context/draw_image.png b/tests/contexts/draw_image.png similarity index 100% rename from tests/images/context/draw_image.png rename to tests/contexts/draw_image.png diff --git a/tests/images/context/draw_image_rhino.png b/tests/contexts/draw_image_rhino.png similarity index 100% rename from tests/images/context/draw_image_rhino.png rename to tests/contexts/draw_image_rhino.png diff --git a/tests/images/context/draw_image_rhino2.png b/tests/contexts/draw_image_rhino2.png similarity index 100% rename from tests/images/context/draw_image_rhino2.png rename to tests/contexts/draw_image_rhino2.png diff --git a/tests/images/context/draw_image_scaled.png b/tests/contexts/draw_image_scaled.png similarity index 100% rename from tests/images/context/draw_image_scaled.png rename to tests/contexts/draw_image_scaled.png diff --git a/tests/images/context/draw_image_self_scaled.png b/tests/contexts/draw_image_self_scaled.png similarity index 100% rename from tests/images/context/draw_image_self_scaled.png rename to tests/contexts/draw_image_self_scaled.png diff --git a/tests/images/context/draw_image_translated.png b/tests/contexts/draw_image_translated.png similarity index 100% rename from tests/images/context/draw_image_translated.png rename to tests/contexts/draw_image_translated.png diff --git a/tests/images/context/ellipse_1.png b/tests/contexts/ellipse_1.png similarity index 100% rename from tests/images/context/ellipse_1.png rename to tests/contexts/ellipse_1.png diff --git a/tests/images/context/fillText_1.png b/tests/contexts/fillText_1.png similarity index 100% rename from tests/images/context/fillText_1.png rename to tests/contexts/fillText_1.png diff --git a/tests/images/context/fill_1.png b/tests/contexts/fill_1.png similarity index 100% rename from tests/images/context/fill_1.png rename to tests/contexts/fill_1.png diff --git a/tests/images/context/globalAlpha_1.png b/tests/contexts/globalAlpha_1.png similarity index 100% rename from tests/images/context/globalAlpha_1.png rename to tests/contexts/globalAlpha_1.png diff --git a/tests/images/context/moveTo_1.png b/tests/contexts/moveTo_1.png similarity index 100% rename from tests/images/context/moveTo_1.png rename to tests/contexts/moveTo_1.png diff --git a/tests/images/context/paintSaveRestore.png b/tests/contexts/paintSaveRestore.png similarity index 100% rename from tests/images/context/paintSaveRestore.png rename to tests/contexts/paintSaveRestore.png diff --git a/tests/images/context/quadracticCurveTo_1.png b/tests/contexts/quadracticCurveTo_1.png similarity index 100% rename from tests/images/context/quadracticCurveTo_1.png rename to tests/contexts/quadracticCurveTo_1.png diff --git a/tests/images/context/quadracticCurveTo_2.png b/tests/contexts/quadracticCurveTo_2.png similarity index 100% rename from tests/images/context/quadracticCurveTo_2.png rename to tests/contexts/quadracticCurveTo_2.png diff --git a/tests/images/context/resetTransform_1.png b/tests/contexts/resetTransform_1.png similarity index 100% rename from tests/images/context/resetTransform_1.png rename to tests/contexts/resetTransform_1.png diff --git a/tests/images/context/resetTransform_2.png b/tests/contexts/resetTransform_2.png similarity index 100% rename from tests/images/context/resetTransform_2.png rename to tests/contexts/resetTransform_2.png diff --git a/tests/images/context/rotate_1.png b/tests/contexts/rotate_1.png similarity index 100% rename from tests/images/context/rotate_1.png rename to tests/contexts/rotate_1.png diff --git a/tests/images/context/save_1.png b/tests/contexts/save_1.png similarity index 100% rename from tests/images/context/save_1.png rename to tests/contexts/save_1.png diff --git a/tests/images/context/scale_1.png b/tests/contexts/scale_1.png similarity index 100% rename from tests/images/context/scale_1.png rename to tests/contexts/scale_1.png diff --git a/tests/images/context/setLineDash_1.png b/tests/contexts/setLineDash_1.png similarity index 100% rename from tests/images/context/setLineDash_1.png rename to tests/contexts/setLineDash_1.png diff --git a/tests/images/context/setTransform_1.png b/tests/contexts/setTransform_1.png similarity index 100% rename from tests/images/context/setTransform_1.png rename to tests/contexts/setTransform_1.png diff --git a/tests/images/context/strokeRect_1.png b/tests/contexts/strokeRect_1.png similarity index 100% rename from tests/images/context/strokeRect_1.png rename to tests/contexts/strokeRect_1.png diff --git a/tests/images/context/strokeRect_2.png b/tests/contexts/strokeRect_2.png similarity index 100% rename from tests/images/context/strokeRect_2.png rename to tests/contexts/strokeRect_2.png diff --git a/tests/images/context/strokeText_1.png b/tests/contexts/strokeText_1.png similarity index 100% rename from tests/images/context/strokeText_1.png rename to tests/contexts/strokeText_1.png diff --git a/tests/images/context/stroke_1.png b/tests/contexts/stroke_1.png similarity index 100% rename from tests/images/context/stroke_1.png rename to tests/contexts/stroke_1.png diff --git a/tests/images/context/stroke_2.png b/tests/contexts/stroke_2.png similarity index 100% rename from tests/images/context/stroke_2.png rename to tests/contexts/stroke_2.png diff --git a/tests/images/context/stroke_3.png b/tests/contexts/stroke_3.png similarity index 100% rename from tests/images/context/stroke_3.png rename to tests/contexts/stroke_3.png diff --git a/tests/images/context/translate_1.png b/tests/contexts/translate_1.png similarity index 100% rename from tests/images/context/translate_1.png rename to tests/contexts/translate_1.png diff --git a/tests/images/bmp/knight.24.bmp b/tests/fileformats/bmp/knight.24.bmp similarity index 100% rename from tests/images/bmp/knight.24.bmp rename to tests/fileformats/bmp/knight.24.bmp diff --git a/tests/images/bmp/knight.24.master.bmp b/tests/fileformats/bmp/knight.24.master.bmp similarity index 100% rename from tests/images/bmp/knight.24.master.bmp rename to tests/fileformats/bmp/knight.24.master.bmp diff --git a/tests/images/bmp/knight.32.bmp b/tests/fileformats/bmp/knight.32.bmp similarity index 100% rename from tests/images/bmp/knight.32.bmp rename to tests/fileformats/bmp/knight.32.bmp diff --git a/tests/images/bmp/knight.32.master.bmp b/tests/fileformats/bmp/knight.32.master.bmp similarity index 100% rename from tests/images/bmp/knight.32.master.bmp rename to tests/fileformats/bmp/knight.32.master.bmp diff --git a/tests/images/bmp/test16x16.bmp b/tests/fileformats/bmp/test16x16.bmp similarity index 100% rename from tests/images/bmp/test16x16.bmp rename to tests/fileformats/bmp/test16x16.bmp diff --git a/tests/images/bmp/test4x2.bmp b/tests/fileformats/bmp/test4x2.bmp similarity index 100% rename from tests/images/bmp/test4x2.bmp rename to tests/fileformats/bmp/test4x2.bmp diff --git a/tests/images/gif/3x5.gif b/tests/fileformats/gif/3x5.gif similarity index 100% rename from tests/images/gif/3x5.gif rename to tests/fileformats/gif/3x5.gif diff --git a/tests/images/gif/3x5.png b/tests/fileformats/gif/3x5.png similarity index 100% rename from tests/images/gif/3x5.png rename to tests/fileformats/gif/3x5.png diff --git a/tests/images/gif/audrey.gif b/tests/fileformats/gif/audrey.gif similarity index 100% rename from tests/images/gif/audrey.gif rename to tests/fileformats/gif/audrey.gif diff --git a/tests/images/gif/audrey.png b/tests/fileformats/gif/audrey.png similarity index 100% rename from tests/images/gif/audrey.png rename to tests/fileformats/gif/audrey.png diff --git a/tests/images/gif/sunflower.gif b/tests/fileformats/gif/sunflower.gif similarity index 100% rename from tests/images/gif/sunflower.gif rename to tests/fileformats/gif/sunflower.gif diff --git a/tests/images/gif/sunflower.png b/tests/fileformats/gif/sunflower.png similarity index 100% rename from tests/images/gif/sunflower.png rename to tests/fileformats/gif/sunflower.png diff --git a/tests/images/jpg/itu-t81.pdf b/tests/fileformats/jpg/itu-t81.pdf similarity index 100% rename from tests/images/jpg/itu-t81.pdf rename to tests/fileformats/jpg/itu-t81.pdf diff --git a/tests/images/jpg/jpeg420exif.jpg b/tests/fileformats/jpg/jpeg420exif.jpg similarity index 100% rename from tests/images/jpg/jpeg420exif.jpg rename to tests/fileformats/jpg/jpeg420exif.jpg diff --git a/tests/images/png/baboon.png b/tests/fileformats/png/baboon.png similarity index 100% rename from tests/images/png/baboon.png rename to tests/fileformats/png/baboon.png diff --git a/tests/images/png/lenna.png b/tests/fileformats/png/lenna.png similarity index 100% rename from tests/images/png/lenna.png rename to tests/fileformats/png/lenna.png diff --git a/tests/images/png/pngsuite/PngSuite.LICENSE b/tests/fileformats/png/pngsuite/PngSuite.LICENSE similarity index 100% rename from tests/images/png/pngsuite/PngSuite.LICENSE rename to tests/fileformats/png/pngsuite/PngSuite.LICENSE diff --git a/tests/images/png/pngsuite/PngSuite.README b/tests/fileformats/png/pngsuite/PngSuite.README similarity index 100% rename from tests/images/png/pngsuite/PngSuite.README rename to tests/fileformats/png/pngsuite/PngSuite.README diff --git a/tests/images/png/pngsuite/PngSuite.png b/tests/fileformats/png/pngsuite/PngSuite.png similarity index 100% rename from tests/images/png/pngsuite/PngSuite.png rename to tests/fileformats/png/pngsuite/PngSuite.png diff --git a/tests/images/png/pngsuite/basi0g01.png b/tests/fileformats/png/pngsuite/basi0g01.png similarity index 100% rename from tests/images/png/pngsuite/basi0g01.png rename to tests/fileformats/png/pngsuite/basi0g01.png diff --git a/tests/images/png/pngsuite/basi0g02.png b/tests/fileformats/png/pngsuite/basi0g02.png similarity index 100% rename from tests/images/png/pngsuite/basi0g02.png rename to tests/fileformats/png/pngsuite/basi0g02.png diff --git a/tests/images/png/pngsuite/basi0g04.png b/tests/fileformats/png/pngsuite/basi0g04.png similarity index 100% rename from tests/images/png/pngsuite/basi0g04.png rename to tests/fileformats/png/pngsuite/basi0g04.png diff --git a/tests/images/png/pngsuite/basi0g08.png b/tests/fileformats/png/pngsuite/basi0g08.png similarity index 100% rename from tests/images/png/pngsuite/basi0g08.png rename to tests/fileformats/png/pngsuite/basi0g08.png diff --git a/tests/images/png/pngsuite/basi0g16.png b/tests/fileformats/png/pngsuite/basi0g16.png similarity index 100% rename from tests/images/png/pngsuite/basi0g16.png rename to tests/fileformats/png/pngsuite/basi0g16.png diff --git a/tests/images/png/pngsuite/basi2c08.png b/tests/fileformats/png/pngsuite/basi2c08.png similarity index 100% rename from tests/images/png/pngsuite/basi2c08.png rename to tests/fileformats/png/pngsuite/basi2c08.png diff --git a/tests/images/png/pngsuite/basi2c16.png b/tests/fileformats/png/pngsuite/basi2c16.png similarity index 100% rename from tests/images/png/pngsuite/basi2c16.png rename to tests/fileformats/png/pngsuite/basi2c16.png diff --git a/tests/images/png/pngsuite/basi3p01.png b/tests/fileformats/png/pngsuite/basi3p01.png similarity index 100% rename from tests/images/png/pngsuite/basi3p01.png rename to tests/fileformats/png/pngsuite/basi3p01.png diff --git a/tests/images/png/pngsuite/basi3p02.png b/tests/fileformats/png/pngsuite/basi3p02.png similarity index 100% rename from tests/images/png/pngsuite/basi3p02.png rename to tests/fileformats/png/pngsuite/basi3p02.png diff --git a/tests/images/png/pngsuite/basi3p04.png b/tests/fileformats/png/pngsuite/basi3p04.png similarity index 100% rename from tests/images/png/pngsuite/basi3p04.png rename to tests/fileformats/png/pngsuite/basi3p04.png diff --git a/tests/images/png/pngsuite/basi3p08.png b/tests/fileformats/png/pngsuite/basi3p08.png similarity index 100% rename from tests/images/png/pngsuite/basi3p08.png rename to tests/fileformats/png/pngsuite/basi3p08.png diff --git a/tests/images/png/pngsuite/basi4a08.png b/tests/fileformats/png/pngsuite/basi4a08.png similarity index 100% rename from tests/images/png/pngsuite/basi4a08.png rename to tests/fileformats/png/pngsuite/basi4a08.png diff --git a/tests/images/png/pngsuite/basi4a16.png b/tests/fileformats/png/pngsuite/basi4a16.png similarity index 100% rename from tests/images/png/pngsuite/basi4a16.png rename to tests/fileformats/png/pngsuite/basi4a16.png diff --git a/tests/images/png/pngsuite/basi6a08.png b/tests/fileformats/png/pngsuite/basi6a08.png similarity index 100% rename from tests/images/png/pngsuite/basi6a08.png rename to tests/fileformats/png/pngsuite/basi6a08.png diff --git a/tests/images/png/pngsuite/basi6a16.png b/tests/fileformats/png/pngsuite/basi6a16.png similarity index 100% rename from tests/images/png/pngsuite/basi6a16.png rename to tests/fileformats/png/pngsuite/basi6a16.png diff --git a/tests/images/png/pngsuite/basn0g01.png b/tests/fileformats/png/pngsuite/basn0g01.png similarity index 100% rename from tests/images/png/pngsuite/basn0g01.png rename to tests/fileformats/png/pngsuite/basn0g01.png diff --git a/tests/images/png/pngsuite/basn0g02.png b/tests/fileformats/png/pngsuite/basn0g02.png similarity index 100% rename from tests/images/png/pngsuite/basn0g02.png rename to tests/fileformats/png/pngsuite/basn0g02.png diff --git a/tests/images/png/pngsuite/basn0g04.png b/tests/fileformats/png/pngsuite/basn0g04.png similarity index 100% rename from tests/images/png/pngsuite/basn0g04.png rename to tests/fileformats/png/pngsuite/basn0g04.png diff --git a/tests/images/png/pngsuite/basn0g08.png b/tests/fileformats/png/pngsuite/basn0g08.png similarity index 100% rename from tests/images/png/pngsuite/basn0g08.png rename to tests/fileformats/png/pngsuite/basn0g08.png diff --git a/tests/images/png/pngsuite/basn0g16.png b/tests/fileformats/png/pngsuite/basn0g16.png similarity index 100% rename from tests/images/png/pngsuite/basn0g16.png rename to tests/fileformats/png/pngsuite/basn0g16.png diff --git a/tests/images/png/pngsuite/basn2c08.png b/tests/fileformats/png/pngsuite/basn2c08.png similarity index 100% rename from tests/images/png/pngsuite/basn2c08.png rename to tests/fileformats/png/pngsuite/basn2c08.png diff --git a/tests/images/png/pngsuite/basn2c16.png b/tests/fileformats/png/pngsuite/basn2c16.png similarity index 100% rename from tests/images/png/pngsuite/basn2c16.png rename to tests/fileformats/png/pngsuite/basn2c16.png diff --git a/tests/images/png/pngsuite/basn3p01.png b/tests/fileformats/png/pngsuite/basn3p01.png similarity index 100% rename from tests/images/png/pngsuite/basn3p01.png rename to tests/fileformats/png/pngsuite/basn3p01.png diff --git a/tests/images/png/pngsuite/basn3p02.png b/tests/fileformats/png/pngsuite/basn3p02.png similarity index 100% rename from tests/images/png/pngsuite/basn3p02.png rename to tests/fileformats/png/pngsuite/basn3p02.png diff --git a/tests/images/png/pngsuite/basn3p04.png b/tests/fileformats/png/pngsuite/basn3p04.png similarity index 100% rename from tests/images/png/pngsuite/basn3p04.png rename to tests/fileformats/png/pngsuite/basn3p04.png diff --git a/tests/images/png/pngsuite/basn3p08.png b/tests/fileformats/png/pngsuite/basn3p08.png similarity index 100% rename from tests/images/png/pngsuite/basn3p08.png rename to tests/fileformats/png/pngsuite/basn3p08.png diff --git a/tests/images/png/pngsuite/basn4a08.png b/tests/fileformats/png/pngsuite/basn4a08.png similarity index 100% rename from tests/images/png/pngsuite/basn4a08.png rename to tests/fileformats/png/pngsuite/basn4a08.png diff --git a/tests/images/png/pngsuite/basn4a16.png b/tests/fileformats/png/pngsuite/basn4a16.png similarity index 100% rename from tests/images/png/pngsuite/basn4a16.png rename to tests/fileformats/png/pngsuite/basn4a16.png diff --git a/tests/images/png/pngsuite/basn6a08.png b/tests/fileformats/png/pngsuite/basn6a08.png similarity index 100% rename from tests/images/png/pngsuite/basn6a08.png rename to tests/fileformats/png/pngsuite/basn6a08.png diff --git a/tests/images/png/pngsuite/basn6a16.png b/tests/fileformats/png/pngsuite/basn6a16.png similarity index 100% rename from tests/images/png/pngsuite/basn6a16.png rename to tests/fileformats/png/pngsuite/basn6a16.png diff --git a/tests/images/png/pngsuite/bgai4a08.png b/tests/fileformats/png/pngsuite/bgai4a08.png similarity index 100% rename from tests/images/png/pngsuite/bgai4a08.png rename to tests/fileformats/png/pngsuite/bgai4a08.png diff --git a/tests/images/png/pngsuite/bgai4a16.png b/tests/fileformats/png/pngsuite/bgai4a16.png similarity index 100% rename from tests/images/png/pngsuite/bgai4a16.png rename to tests/fileformats/png/pngsuite/bgai4a16.png diff --git a/tests/images/png/pngsuite/bgan6a08.png b/tests/fileformats/png/pngsuite/bgan6a08.png similarity index 100% rename from tests/images/png/pngsuite/bgan6a08.png rename to tests/fileformats/png/pngsuite/bgan6a08.png diff --git a/tests/images/png/pngsuite/bgan6a16.png b/tests/fileformats/png/pngsuite/bgan6a16.png similarity index 100% rename from tests/images/png/pngsuite/bgan6a16.png rename to tests/fileformats/png/pngsuite/bgan6a16.png diff --git a/tests/images/png/pngsuite/bgbn4a08.png b/tests/fileformats/png/pngsuite/bgbn4a08.png similarity index 100% rename from tests/images/png/pngsuite/bgbn4a08.png rename to tests/fileformats/png/pngsuite/bgbn4a08.png diff --git a/tests/images/png/pngsuite/bggn4a16.png b/tests/fileformats/png/pngsuite/bggn4a16.png similarity index 100% rename from tests/images/png/pngsuite/bggn4a16.png rename to tests/fileformats/png/pngsuite/bggn4a16.png diff --git a/tests/images/png/pngsuite/bgwn6a08.png b/tests/fileformats/png/pngsuite/bgwn6a08.png similarity index 100% rename from tests/images/png/pngsuite/bgwn6a08.png rename to tests/fileformats/png/pngsuite/bgwn6a08.png diff --git a/tests/images/png/pngsuite/bgyn6a16.png b/tests/fileformats/png/pngsuite/bgyn6a16.png similarity index 100% rename from tests/images/png/pngsuite/bgyn6a16.png rename to tests/fileformats/png/pngsuite/bgyn6a16.png diff --git a/tests/images/png/pngsuite/ccwn2c08.png b/tests/fileformats/png/pngsuite/ccwn2c08.png similarity index 100% rename from tests/images/png/pngsuite/ccwn2c08.png rename to tests/fileformats/png/pngsuite/ccwn2c08.png diff --git a/tests/images/png/pngsuite/ccwn3p08.png b/tests/fileformats/png/pngsuite/ccwn3p08.png similarity index 100% rename from tests/images/png/pngsuite/ccwn3p08.png rename to tests/fileformats/png/pngsuite/ccwn3p08.png diff --git a/tests/images/png/pngsuite/cdfn2c08.png b/tests/fileformats/png/pngsuite/cdfn2c08.png similarity index 100% rename from tests/images/png/pngsuite/cdfn2c08.png rename to tests/fileformats/png/pngsuite/cdfn2c08.png diff --git a/tests/images/png/pngsuite/cdhn2c08.png b/tests/fileformats/png/pngsuite/cdhn2c08.png similarity index 100% rename from tests/images/png/pngsuite/cdhn2c08.png rename to tests/fileformats/png/pngsuite/cdhn2c08.png diff --git a/tests/images/png/pngsuite/cdsn2c08.png b/tests/fileformats/png/pngsuite/cdsn2c08.png similarity index 100% rename from tests/images/png/pngsuite/cdsn2c08.png rename to tests/fileformats/png/pngsuite/cdsn2c08.png diff --git a/tests/images/png/pngsuite/cdun2c08.png b/tests/fileformats/png/pngsuite/cdun2c08.png similarity index 100% rename from tests/images/png/pngsuite/cdun2c08.png rename to tests/fileformats/png/pngsuite/cdun2c08.png diff --git a/tests/images/png/pngsuite/ch1n3p04.png b/tests/fileformats/png/pngsuite/ch1n3p04.png similarity index 100% rename from tests/images/png/pngsuite/ch1n3p04.png rename to tests/fileformats/png/pngsuite/ch1n3p04.png diff --git a/tests/images/png/pngsuite/ch2n3p08.png b/tests/fileformats/png/pngsuite/ch2n3p08.png similarity index 100% rename from tests/images/png/pngsuite/ch2n3p08.png rename to tests/fileformats/png/pngsuite/ch2n3p08.png diff --git a/tests/images/png/pngsuite/cm0n0g04.png b/tests/fileformats/png/pngsuite/cm0n0g04.png similarity index 100% rename from tests/images/png/pngsuite/cm0n0g04.png rename to tests/fileformats/png/pngsuite/cm0n0g04.png diff --git a/tests/images/png/pngsuite/cm7n0g04.png b/tests/fileformats/png/pngsuite/cm7n0g04.png similarity index 100% rename from tests/images/png/pngsuite/cm7n0g04.png rename to tests/fileformats/png/pngsuite/cm7n0g04.png diff --git a/tests/images/png/pngsuite/cm9n0g04.png b/tests/fileformats/png/pngsuite/cm9n0g04.png similarity index 100% rename from tests/images/png/pngsuite/cm9n0g04.png rename to tests/fileformats/png/pngsuite/cm9n0g04.png diff --git a/tests/images/png/pngsuite/cs3n2c16.png b/tests/fileformats/png/pngsuite/cs3n2c16.png similarity index 100% rename from tests/images/png/pngsuite/cs3n2c16.png rename to tests/fileformats/png/pngsuite/cs3n2c16.png diff --git a/tests/images/png/pngsuite/cs3n3p08.png b/tests/fileformats/png/pngsuite/cs3n3p08.png similarity index 100% rename from tests/images/png/pngsuite/cs3n3p08.png rename to tests/fileformats/png/pngsuite/cs3n3p08.png diff --git a/tests/images/png/pngsuite/cs5n2c08.png b/tests/fileformats/png/pngsuite/cs5n2c08.png similarity index 100% rename from tests/images/png/pngsuite/cs5n2c08.png rename to tests/fileformats/png/pngsuite/cs5n2c08.png diff --git a/tests/images/png/pngsuite/cs5n3p08.png b/tests/fileformats/png/pngsuite/cs5n3p08.png similarity index 100% rename from tests/images/png/pngsuite/cs5n3p08.png rename to tests/fileformats/png/pngsuite/cs5n3p08.png diff --git a/tests/images/png/pngsuite/cs8n2c08.png b/tests/fileformats/png/pngsuite/cs8n2c08.png similarity index 100% rename from tests/images/png/pngsuite/cs8n2c08.png rename to tests/fileformats/png/pngsuite/cs8n2c08.png diff --git a/tests/images/png/pngsuite/cs8n3p08.png b/tests/fileformats/png/pngsuite/cs8n3p08.png similarity index 100% rename from tests/images/png/pngsuite/cs8n3p08.png rename to tests/fileformats/png/pngsuite/cs8n3p08.png diff --git a/tests/images/png/pngsuite/ct0n0g04.png b/tests/fileformats/png/pngsuite/ct0n0g04.png similarity index 100% rename from tests/images/png/pngsuite/ct0n0g04.png rename to tests/fileformats/png/pngsuite/ct0n0g04.png diff --git a/tests/images/png/pngsuite/ct1n0g04.png b/tests/fileformats/png/pngsuite/ct1n0g04.png similarity index 100% rename from tests/images/png/pngsuite/ct1n0g04.png rename to tests/fileformats/png/pngsuite/ct1n0g04.png diff --git a/tests/images/png/pngsuite/cten0g04.png b/tests/fileformats/png/pngsuite/cten0g04.png similarity index 100% rename from tests/images/png/pngsuite/cten0g04.png rename to tests/fileformats/png/pngsuite/cten0g04.png diff --git a/tests/images/png/pngsuite/ctfn0g04.png b/tests/fileformats/png/pngsuite/ctfn0g04.png similarity index 100% rename from tests/images/png/pngsuite/ctfn0g04.png rename to tests/fileformats/png/pngsuite/ctfn0g04.png diff --git a/tests/images/png/pngsuite/ctgn0g04.png b/tests/fileformats/png/pngsuite/ctgn0g04.png similarity index 100% rename from tests/images/png/pngsuite/ctgn0g04.png rename to tests/fileformats/png/pngsuite/ctgn0g04.png diff --git a/tests/images/png/pngsuite/cthn0g04.png b/tests/fileformats/png/pngsuite/cthn0g04.png similarity index 100% rename from tests/images/png/pngsuite/cthn0g04.png rename to tests/fileformats/png/pngsuite/cthn0g04.png diff --git a/tests/images/png/pngsuite/ctjn0g04.png b/tests/fileformats/png/pngsuite/ctjn0g04.png similarity index 100% rename from tests/images/png/pngsuite/ctjn0g04.png rename to tests/fileformats/png/pngsuite/ctjn0g04.png diff --git a/tests/images/png/pngsuite/ctzn0g04.png b/tests/fileformats/png/pngsuite/ctzn0g04.png similarity index 100% rename from tests/images/png/pngsuite/ctzn0g04.png rename to tests/fileformats/png/pngsuite/ctzn0g04.png diff --git a/tests/images/png/pngsuite/exif2c08.png b/tests/fileformats/png/pngsuite/exif2c08.png similarity index 100% rename from tests/images/png/pngsuite/exif2c08.png rename to tests/fileformats/png/pngsuite/exif2c08.png diff --git a/tests/images/png/pngsuite/f00n0g08.png b/tests/fileformats/png/pngsuite/f00n0g08.png similarity index 100% rename from tests/images/png/pngsuite/f00n0g08.png rename to tests/fileformats/png/pngsuite/f00n0g08.png diff --git a/tests/images/png/pngsuite/f00n2c08.png b/tests/fileformats/png/pngsuite/f00n2c08.png similarity index 100% rename from tests/images/png/pngsuite/f00n2c08.png rename to tests/fileformats/png/pngsuite/f00n2c08.png diff --git a/tests/images/png/pngsuite/f01n0g08.png b/tests/fileformats/png/pngsuite/f01n0g08.png similarity index 100% rename from tests/images/png/pngsuite/f01n0g08.png rename to tests/fileformats/png/pngsuite/f01n0g08.png diff --git a/tests/images/png/pngsuite/f01n2c08.png b/tests/fileformats/png/pngsuite/f01n2c08.png similarity index 100% rename from tests/images/png/pngsuite/f01n2c08.png rename to tests/fileformats/png/pngsuite/f01n2c08.png diff --git a/tests/images/png/pngsuite/f02n0g08.png b/tests/fileformats/png/pngsuite/f02n0g08.png similarity index 100% rename from tests/images/png/pngsuite/f02n0g08.png rename to tests/fileformats/png/pngsuite/f02n0g08.png diff --git a/tests/images/png/pngsuite/f02n2c08.png b/tests/fileformats/png/pngsuite/f02n2c08.png similarity index 100% rename from tests/images/png/pngsuite/f02n2c08.png rename to tests/fileformats/png/pngsuite/f02n2c08.png diff --git a/tests/images/png/pngsuite/f03n0g08.png b/tests/fileformats/png/pngsuite/f03n0g08.png similarity index 100% rename from tests/images/png/pngsuite/f03n0g08.png rename to tests/fileformats/png/pngsuite/f03n0g08.png diff --git a/tests/images/png/pngsuite/f03n2c08.png b/tests/fileformats/png/pngsuite/f03n2c08.png similarity index 100% rename from tests/images/png/pngsuite/f03n2c08.png rename to tests/fileformats/png/pngsuite/f03n2c08.png diff --git a/tests/images/png/pngsuite/f04n0g08.png b/tests/fileformats/png/pngsuite/f04n0g08.png similarity index 100% rename from tests/images/png/pngsuite/f04n0g08.png rename to tests/fileformats/png/pngsuite/f04n0g08.png diff --git a/tests/images/png/pngsuite/f04n2c08.png b/tests/fileformats/png/pngsuite/f04n2c08.png similarity index 100% rename from tests/images/png/pngsuite/f04n2c08.png rename to tests/fileformats/png/pngsuite/f04n2c08.png diff --git a/tests/images/png/pngsuite/f99n0g04.png b/tests/fileformats/png/pngsuite/f99n0g04.png similarity index 100% rename from tests/images/png/pngsuite/f99n0g04.png rename to tests/fileformats/png/pngsuite/f99n0g04.png diff --git a/tests/images/png/pngsuite/g03n0g16.png b/tests/fileformats/png/pngsuite/g03n0g16.png similarity index 100% rename from tests/images/png/pngsuite/g03n0g16.png rename to tests/fileformats/png/pngsuite/g03n0g16.png diff --git a/tests/images/png/pngsuite/g03n2c08.png b/tests/fileformats/png/pngsuite/g03n2c08.png similarity index 100% rename from tests/images/png/pngsuite/g03n2c08.png rename to tests/fileformats/png/pngsuite/g03n2c08.png diff --git a/tests/images/png/pngsuite/g03n3p04.png b/tests/fileformats/png/pngsuite/g03n3p04.png similarity index 100% rename from tests/images/png/pngsuite/g03n3p04.png rename to tests/fileformats/png/pngsuite/g03n3p04.png diff --git a/tests/images/png/pngsuite/g04n0g16.png b/tests/fileformats/png/pngsuite/g04n0g16.png similarity index 100% rename from tests/images/png/pngsuite/g04n0g16.png rename to tests/fileformats/png/pngsuite/g04n0g16.png diff --git a/tests/images/png/pngsuite/g04n2c08.png b/tests/fileformats/png/pngsuite/g04n2c08.png similarity index 100% rename from tests/images/png/pngsuite/g04n2c08.png rename to tests/fileformats/png/pngsuite/g04n2c08.png diff --git a/tests/images/png/pngsuite/g04n3p04.png b/tests/fileformats/png/pngsuite/g04n3p04.png similarity index 100% rename from tests/images/png/pngsuite/g04n3p04.png rename to tests/fileformats/png/pngsuite/g04n3p04.png diff --git a/tests/images/png/pngsuite/g05n0g16.png b/tests/fileformats/png/pngsuite/g05n0g16.png similarity index 100% rename from tests/images/png/pngsuite/g05n0g16.png rename to tests/fileformats/png/pngsuite/g05n0g16.png diff --git a/tests/images/png/pngsuite/g05n2c08.png b/tests/fileformats/png/pngsuite/g05n2c08.png similarity index 100% rename from tests/images/png/pngsuite/g05n2c08.png rename to tests/fileformats/png/pngsuite/g05n2c08.png diff --git a/tests/images/png/pngsuite/g05n3p04.png b/tests/fileformats/png/pngsuite/g05n3p04.png similarity index 100% rename from tests/images/png/pngsuite/g05n3p04.png rename to tests/fileformats/png/pngsuite/g05n3p04.png diff --git a/tests/images/png/pngsuite/g07n0g16.png b/tests/fileformats/png/pngsuite/g07n0g16.png similarity index 100% rename from tests/images/png/pngsuite/g07n0g16.png rename to tests/fileformats/png/pngsuite/g07n0g16.png diff --git a/tests/images/png/pngsuite/g07n2c08.png b/tests/fileformats/png/pngsuite/g07n2c08.png similarity index 100% rename from tests/images/png/pngsuite/g07n2c08.png rename to tests/fileformats/png/pngsuite/g07n2c08.png diff --git a/tests/images/png/pngsuite/g07n3p04.png b/tests/fileformats/png/pngsuite/g07n3p04.png similarity index 100% rename from tests/images/png/pngsuite/g07n3p04.png rename to tests/fileformats/png/pngsuite/g07n3p04.png diff --git a/tests/images/png/pngsuite/g10n0g16.png b/tests/fileformats/png/pngsuite/g10n0g16.png similarity index 100% rename from tests/images/png/pngsuite/g10n0g16.png rename to tests/fileformats/png/pngsuite/g10n0g16.png diff --git a/tests/images/png/pngsuite/g10n2c08.png b/tests/fileformats/png/pngsuite/g10n2c08.png similarity index 100% rename from tests/images/png/pngsuite/g10n2c08.png rename to tests/fileformats/png/pngsuite/g10n2c08.png diff --git a/tests/images/png/pngsuite/g10n3p04.png b/tests/fileformats/png/pngsuite/g10n3p04.png similarity index 100% rename from tests/images/png/pngsuite/g10n3p04.png rename to tests/fileformats/png/pngsuite/g10n3p04.png diff --git a/tests/images/png/pngsuite/g25n0g16.png b/tests/fileformats/png/pngsuite/g25n0g16.png similarity index 100% rename from tests/images/png/pngsuite/g25n0g16.png rename to tests/fileformats/png/pngsuite/g25n0g16.png diff --git a/tests/images/png/pngsuite/g25n2c08.png b/tests/fileformats/png/pngsuite/g25n2c08.png similarity index 100% rename from tests/images/png/pngsuite/g25n2c08.png rename to tests/fileformats/png/pngsuite/g25n2c08.png diff --git a/tests/images/png/pngsuite/g25n3p04.png b/tests/fileformats/png/pngsuite/g25n3p04.png similarity index 100% rename from tests/images/png/pngsuite/g25n3p04.png rename to tests/fileformats/png/pngsuite/g25n3p04.png diff --git a/tests/images/png/pngsuite/oi1n0g16.png b/tests/fileformats/png/pngsuite/oi1n0g16.png similarity index 100% rename from tests/images/png/pngsuite/oi1n0g16.png rename to tests/fileformats/png/pngsuite/oi1n0g16.png diff --git a/tests/images/png/pngsuite/oi1n2c16.png b/tests/fileformats/png/pngsuite/oi1n2c16.png similarity index 100% rename from tests/images/png/pngsuite/oi1n2c16.png rename to tests/fileformats/png/pngsuite/oi1n2c16.png diff --git a/tests/images/png/pngsuite/oi2n0g16.png b/tests/fileformats/png/pngsuite/oi2n0g16.png similarity index 100% rename from tests/images/png/pngsuite/oi2n0g16.png rename to tests/fileformats/png/pngsuite/oi2n0g16.png diff --git a/tests/images/png/pngsuite/oi2n2c16.png b/tests/fileformats/png/pngsuite/oi2n2c16.png similarity index 100% rename from tests/images/png/pngsuite/oi2n2c16.png rename to tests/fileformats/png/pngsuite/oi2n2c16.png diff --git a/tests/images/png/pngsuite/oi4n0g16.png b/tests/fileformats/png/pngsuite/oi4n0g16.png similarity index 100% rename from tests/images/png/pngsuite/oi4n0g16.png rename to tests/fileformats/png/pngsuite/oi4n0g16.png diff --git a/tests/images/png/pngsuite/oi4n2c16.png b/tests/fileformats/png/pngsuite/oi4n2c16.png similarity index 100% rename from tests/images/png/pngsuite/oi4n2c16.png rename to tests/fileformats/png/pngsuite/oi4n2c16.png diff --git a/tests/images/png/pngsuite/oi9n0g16.png b/tests/fileformats/png/pngsuite/oi9n0g16.png similarity index 100% rename from tests/images/png/pngsuite/oi9n0g16.png rename to tests/fileformats/png/pngsuite/oi9n0g16.png diff --git a/tests/images/png/pngsuite/oi9n2c16.png b/tests/fileformats/png/pngsuite/oi9n2c16.png similarity index 100% rename from tests/images/png/pngsuite/oi9n2c16.png rename to tests/fileformats/png/pngsuite/oi9n2c16.png diff --git a/tests/images/png/pngsuite/pp0n2c16.png b/tests/fileformats/png/pngsuite/pp0n2c16.png similarity index 100% rename from tests/images/png/pngsuite/pp0n2c16.png rename to tests/fileformats/png/pngsuite/pp0n2c16.png diff --git a/tests/images/png/pngsuite/pp0n6a08.png b/tests/fileformats/png/pngsuite/pp0n6a08.png similarity index 100% rename from tests/images/png/pngsuite/pp0n6a08.png rename to tests/fileformats/png/pngsuite/pp0n6a08.png diff --git a/tests/images/png/pngsuite/ps1n0g08.png b/tests/fileformats/png/pngsuite/ps1n0g08.png similarity index 100% rename from tests/images/png/pngsuite/ps1n0g08.png rename to tests/fileformats/png/pngsuite/ps1n0g08.png diff --git a/tests/images/png/pngsuite/ps1n2c16.png b/tests/fileformats/png/pngsuite/ps1n2c16.png similarity index 100% rename from tests/images/png/pngsuite/ps1n2c16.png rename to tests/fileformats/png/pngsuite/ps1n2c16.png diff --git a/tests/images/png/pngsuite/ps2n0g08.png b/tests/fileformats/png/pngsuite/ps2n0g08.png similarity index 100% rename from tests/images/png/pngsuite/ps2n0g08.png rename to tests/fileformats/png/pngsuite/ps2n0g08.png diff --git a/tests/images/png/pngsuite/ps2n2c16.png b/tests/fileformats/png/pngsuite/ps2n2c16.png similarity index 100% rename from tests/images/png/pngsuite/ps2n2c16.png rename to tests/fileformats/png/pngsuite/ps2n2c16.png diff --git a/tests/images/png/pngsuite/s01i3p01.png b/tests/fileformats/png/pngsuite/s01i3p01.png similarity index 100% rename from tests/images/png/pngsuite/s01i3p01.png rename to tests/fileformats/png/pngsuite/s01i3p01.png diff --git a/tests/images/png/pngsuite/s01n3p01.png b/tests/fileformats/png/pngsuite/s01n3p01.png similarity index 100% rename from tests/images/png/pngsuite/s01n3p01.png rename to tests/fileformats/png/pngsuite/s01n3p01.png diff --git a/tests/images/png/pngsuite/s02i3p01.png b/tests/fileformats/png/pngsuite/s02i3p01.png similarity index 100% rename from tests/images/png/pngsuite/s02i3p01.png rename to tests/fileformats/png/pngsuite/s02i3p01.png diff --git a/tests/images/png/pngsuite/s02n3p01.png b/tests/fileformats/png/pngsuite/s02n3p01.png similarity index 100% rename from tests/images/png/pngsuite/s02n3p01.png rename to tests/fileformats/png/pngsuite/s02n3p01.png diff --git a/tests/images/png/pngsuite/s03i3p01.png b/tests/fileformats/png/pngsuite/s03i3p01.png similarity index 100% rename from tests/images/png/pngsuite/s03i3p01.png rename to tests/fileformats/png/pngsuite/s03i3p01.png diff --git a/tests/images/png/pngsuite/s03n3p01.png b/tests/fileformats/png/pngsuite/s03n3p01.png similarity index 100% rename from tests/images/png/pngsuite/s03n3p01.png rename to tests/fileformats/png/pngsuite/s03n3p01.png diff --git a/tests/images/png/pngsuite/s04i3p01.png b/tests/fileformats/png/pngsuite/s04i3p01.png similarity index 100% rename from tests/images/png/pngsuite/s04i3p01.png rename to tests/fileformats/png/pngsuite/s04i3p01.png diff --git a/tests/images/png/pngsuite/s04n3p01.png b/tests/fileformats/png/pngsuite/s04n3p01.png similarity index 100% rename from tests/images/png/pngsuite/s04n3p01.png rename to tests/fileformats/png/pngsuite/s04n3p01.png diff --git a/tests/images/png/pngsuite/s05i3p02.png b/tests/fileformats/png/pngsuite/s05i3p02.png similarity index 100% rename from tests/images/png/pngsuite/s05i3p02.png rename to tests/fileformats/png/pngsuite/s05i3p02.png diff --git a/tests/images/png/pngsuite/s05n3p02.png b/tests/fileformats/png/pngsuite/s05n3p02.png similarity index 100% rename from tests/images/png/pngsuite/s05n3p02.png rename to tests/fileformats/png/pngsuite/s05n3p02.png diff --git a/tests/images/png/pngsuite/s06i3p02.png b/tests/fileformats/png/pngsuite/s06i3p02.png similarity index 100% rename from tests/images/png/pngsuite/s06i3p02.png rename to tests/fileformats/png/pngsuite/s06i3p02.png diff --git a/tests/images/png/pngsuite/s06n3p02.png b/tests/fileformats/png/pngsuite/s06n3p02.png similarity index 100% rename from tests/images/png/pngsuite/s06n3p02.png rename to tests/fileformats/png/pngsuite/s06n3p02.png diff --git a/tests/images/png/pngsuite/s07i3p02.png b/tests/fileformats/png/pngsuite/s07i3p02.png similarity index 100% rename from tests/images/png/pngsuite/s07i3p02.png rename to tests/fileformats/png/pngsuite/s07i3p02.png diff --git a/tests/images/png/pngsuite/s07n3p02.png b/tests/fileformats/png/pngsuite/s07n3p02.png similarity index 100% rename from tests/images/png/pngsuite/s07n3p02.png rename to tests/fileformats/png/pngsuite/s07n3p02.png diff --git a/tests/images/png/pngsuite/s08i3p02.png b/tests/fileformats/png/pngsuite/s08i3p02.png similarity index 100% rename from tests/images/png/pngsuite/s08i3p02.png rename to tests/fileformats/png/pngsuite/s08i3p02.png diff --git a/tests/images/png/pngsuite/s08n3p02.png b/tests/fileformats/png/pngsuite/s08n3p02.png similarity index 100% rename from tests/images/png/pngsuite/s08n3p02.png rename to tests/fileformats/png/pngsuite/s08n3p02.png diff --git a/tests/images/png/pngsuite/s09i3p02.png b/tests/fileformats/png/pngsuite/s09i3p02.png similarity index 100% rename from tests/images/png/pngsuite/s09i3p02.png rename to tests/fileformats/png/pngsuite/s09i3p02.png diff --git a/tests/images/png/pngsuite/s09n3p02.png b/tests/fileformats/png/pngsuite/s09n3p02.png similarity index 100% rename from tests/images/png/pngsuite/s09n3p02.png rename to tests/fileformats/png/pngsuite/s09n3p02.png diff --git a/tests/images/png/pngsuite/s32i3p04.png b/tests/fileformats/png/pngsuite/s32i3p04.png similarity index 100% rename from tests/images/png/pngsuite/s32i3p04.png rename to tests/fileformats/png/pngsuite/s32i3p04.png diff --git a/tests/images/png/pngsuite/s32n3p04.png b/tests/fileformats/png/pngsuite/s32n3p04.png similarity index 100% rename from tests/images/png/pngsuite/s32n3p04.png rename to tests/fileformats/png/pngsuite/s32n3p04.png diff --git a/tests/images/png/pngsuite/s33i3p04.png b/tests/fileformats/png/pngsuite/s33i3p04.png similarity index 100% rename from tests/images/png/pngsuite/s33i3p04.png rename to tests/fileformats/png/pngsuite/s33i3p04.png diff --git a/tests/images/png/pngsuite/s33n3p04.png b/tests/fileformats/png/pngsuite/s33n3p04.png similarity index 100% rename from tests/images/png/pngsuite/s33n3p04.png rename to tests/fileformats/png/pngsuite/s33n3p04.png diff --git a/tests/images/png/pngsuite/s34i3p04.png b/tests/fileformats/png/pngsuite/s34i3p04.png similarity index 100% rename from tests/images/png/pngsuite/s34i3p04.png rename to tests/fileformats/png/pngsuite/s34i3p04.png diff --git a/tests/images/png/pngsuite/s34n3p04.png b/tests/fileformats/png/pngsuite/s34n3p04.png similarity index 100% rename from tests/images/png/pngsuite/s34n3p04.png rename to tests/fileformats/png/pngsuite/s34n3p04.png diff --git a/tests/images/png/pngsuite/s35i3p04.png b/tests/fileformats/png/pngsuite/s35i3p04.png similarity index 100% rename from tests/images/png/pngsuite/s35i3p04.png rename to tests/fileformats/png/pngsuite/s35i3p04.png diff --git a/tests/images/png/pngsuite/s35n3p04.png b/tests/fileformats/png/pngsuite/s35n3p04.png similarity index 100% rename from tests/images/png/pngsuite/s35n3p04.png rename to tests/fileformats/png/pngsuite/s35n3p04.png diff --git a/tests/images/png/pngsuite/s36i3p04.png b/tests/fileformats/png/pngsuite/s36i3p04.png similarity index 100% rename from tests/images/png/pngsuite/s36i3p04.png rename to tests/fileformats/png/pngsuite/s36i3p04.png diff --git a/tests/images/png/pngsuite/s36n3p04.png b/tests/fileformats/png/pngsuite/s36n3p04.png similarity index 100% rename from tests/images/png/pngsuite/s36n3p04.png rename to tests/fileformats/png/pngsuite/s36n3p04.png diff --git a/tests/images/png/pngsuite/s37i3p04.png b/tests/fileformats/png/pngsuite/s37i3p04.png similarity index 100% rename from tests/images/png/pngsuite/s37i3p04.png rename to tests/fileformats/png/pngsuite/s37i3p04.png diff --git a/tests/images/png/pngsuite/s37n3p04.png b/tests/fileformats/png/pngsuite/s37n3p04.png similarity index 100% rename from tests/images/png/pngsuite/s37n3p04.png rename to tests/fileformats/png/pngsuite/s37n3p04.png diff --git a/tests/images/png/pngsuite/s38i3p04.png b/tests/fileformats/png/pngsuite/s38i3p04.png similarity index 100% rename from tests/images/png/pngsuite/s38i3p04.png rename to tests/fileformats/png/pngsuite/s38i3p04.png diff --git a/tests/images/png/pngsuite/s38n3p04.png b/tests/fileformats/png/pngsuite/s38n3p04.png similarity index 100% rename from tests/images/png/pngsuite/s38n3p04.png rename to tests/fileformats/png/pngsuite/s38n3p04.png diff --git a/tests/images/png/pngsuite/s39i3p04.png b/tests/fileformats/png/pngsuite/s39i3p04.png similarity index 100% rename from tests/images/png/pngsuite/s39i3p04.png rename to tests/fileformats/png/pngsuite/s39i3p04.png diff --git a/tests/images/png/pngsuite/s39n3p04.png b/tests/fileformats/png/pngsuite/s39n3p04.png similarity index 100% rename from tests/images/png/pngsuite/s39n3p04.png rename to tests/fileformats/png/pngsuite/s39n3p04.png diff --git a/tests/images/png/pngsuite/s40i3p04.png b/tests/fileformats/png/pngsuite/s40i3p04.png similarity index 100% rename from tests/images/png/pngsuite/s40i3p04.png rename to tests/fileformats/png/pngsuite/s40i3p04.png diff --git a/tests/images/png/pngsuite/s40n3p04.png b/tests/fileformats/png/pngsuite/s40n3p04.png similarity index 100% rename from tests/images/png/pngsuite/s40n3p04.png rename to tests/fileformats/png/pngsuite/s40n3p04.png diff --git a/tests/images/png/pngsuite/tbbn0g04.png b/tests/fileformats/png/pngsuite/tbbn0g04.png similarity index 100% rename from tests/images/png/pngsuite/tbbn0g04.png rename to tests/fileformats/png/pngsuite/tbbn0g04.png diff --git a/tests/images/png/pngsuite/tbbn2c16.png b/tests/fileformats/png/pngsuite/tbbn2c16.png similarity index 100% rename from tests/images/png/pngsuite/tbbn2c16.png rename to tests/fileformats/png/pngsuite/tbbn2c16.png diff --git a/tests/images/png/pngsuite/tbbn3p08.png b/tests/fileformats/png/pngsuite/tbbn3p08.png similarity index 100% rename from tests/images/png/pngsuite/tbbn3p08.png rename to tests/fileformats/png/pngsuite/tbbn3p08.png diff --git a/tests/images/png/pngsuite/tbgn2c16.png b/tests/fileformats/png/pngsuite/tbgn2c16.png similarity index 100% rename from tests/images/png/pngsuite/tbgn2c16.png rename to tests/fileformats/png/pngsuite/tbgn2c16.png diff --git a/tests/images/png/pngsuite/tbgn3p08.png b/tests/fileformats/png/pngsuite/tbgn3p08.png similarity index 100% rename from tests/images/png/pngsuite/tbgn3p08.png rename to tests/fileformats/png/pngsuite/tbgn3p08.png diff --git a/tests/images/png/pngsuite/tbrn2c08.png b/tests/fileformats/png/pngsuite/tbrn2c08.png similarity index 100% rename from tests/images/png/pngsuite/tbrn2c08.png rename to tests/fileformats/png/pngsuite/tbrn2c08.png diff --git a/tests/images/png/pngsuite/tbwn0g16.png b/tests/fileformats/png/pngsuite/tbwn0g16.png similarity index 100% rename from tests/images/png/pngsuite/tbwn0g16.png rename to tests/fileformats/png/pngsuite/tbwn0g16.png diff --git a/tests/images/png/pngsuite/tbwn3p08.png b/tests/fileformats/png/pngsuite/tbwn3p08.png similarity index 100% rename from tests/images/png/pngsuite/tbwn3p08.png rename to tests/fileformats/png/pngsuite/tbwn3p08.png diff --git a/tests/images/png/pngsuite/tbyn3p08.png b/tests/fileformats/png/pngsuite/tbyn3p08.png similarity index 100% rename from tests/images/png/pngsuite/tbyn3p08.png rename to tests/fileformats/png/pngsuite/tbyn3p08.png diff --git a/tests/images/png/pngsuite/tm3n3p02.png b/tests/fileformats/png/pngsuite/tm3n3p02.png similarity index 100% rename from tests/images/png/pngsuite/tm3n3p02.png rename to tests/fileformats/png/pngsuite/tm3n3p02.png diff --git a/tests/images/png/pngsuite/tp0n0g08.png b/tests/fileformats/png/pngsuite/tp0n0g08.png similarity index 100% rename from tests/images/png/pngsuite/tp0n0g08.png rename to tests/fileformats/png/pngsuite/tp0n0g08.png diff --git a/tests/images/png/pngsuite/tp0n2c08.png b/tests/fileformats/png/pngsuite/tp0n2c08.png similarity index 100% rename from tests/images/png/pngsuite/tp0n2c08.png rename to tests/fileformats/png/pngsuite/tp0n2c08.png diff --git a/tests/images/png/pngsuite/tp0n3p08.png b/tests/fileformats/png/pngsuite/tp0n3p08.png similarity index 100% rename from tests/images/png/pngsuite/tp0n3p08.png rename to tests/fileformats/png/pngsuite/tp0n3p08.png diff --git a/tests/images/png/pngsuite/tp1n3p08.png b/tests/fileformats/png/pngsuite/tp1n3p08.png similarity index 100% rename from tests/images/png/pngsuite/tp1n3p08.png rename to tests/fileformats/png/pngsuite/tp1n3p08.png diff --git a/tests/images/png/pngsuite/xc1n0g08.png b/tests/fileformats/png/pngsuite/xc1n0g08.png similarity index 100% rename from tests/images/png/pngsuite/xc1n0g08.png rename to tests/fileformats/png/pngsuite/xc1n0g08.png diff --git a/tests/images/png/pngsuite/xc9n2c08.png b/tests/fileformats/png/pngsuite/xc9n2c08.png similarity index 100% rename from tests/images/png/pngsuite/xc9n2c08.png rename to tests/fileformats/png/pngsuite/xc9n2c08.png diff --git a/tests/images/png/pngsuite/xcrn0g04.png b/tests/fileformats/png/pngsuite/xcrn0g04.png similarity index 100% rename from tests/images/png/pngsuite/xcrn0g04.png rename to tests/fileformats/png/pngsuite/xcrn0g04.png diff --git a/tests/images/png/pngsuite/xcsn0g01.png b/tests/fileformats/png/pngsuite/xcsn0g01.png similarity index 100% rename from tests/images/png/pngsuite/xcsn0g01.png rename to tests/fileformats/png/pngsuite/xcsn0g01.png diff --git a/tests/images/png/pngsuite/xd0n2c08.png b/tests/fileformats/png/pngsuite/xd0n2c08.png similarity index 100% rename from tests/images/png/pngsuite/xd0n2c08.png rename to tests/fileformats/png/pngsuite/xd0n2c08.png diff --git a/tests/images/png/pngsuite/xd3n2c08.png b/tests/fileformats/png/pngsuite/xd3n2c08.png similarity index 100% rename from tests/images/png/pngsuite/xd3n2c08.png rename to tests/fileformats/png/pngsuite/xd3n2c08.png diff --git a/tests/images/png/pngsuite/xd9n2c08.png b/tests/fileformats/png/pngsuite/xd9n2c08.png similarity index 100% rename from tests/images/png/pngsuite/xd9n2c08.png rename to tests/fileformats/png/pngsuite/xd9n2c08.png diff --git a/tests/images/png/pngsuite/xdtn0g01.png b/tests/fileformats/png/pngsuite/xdtn0g01.png similarity index 100% rename from tests/images/png/pngsuite/xdtn0g01.png rename to tests/fileformats/png/pngsuite/xdtn0g01.png diff --git a/tests/images/png/pngsuite/xhdn0g08.png b/tests/fileformats/png/pngsuite/xhdn0g08.png similarity index 100% rename from tests/images/png/pngsuite/xhdn0g08.png rename to tests/fileformats/png/pngsuite/xhdn0g08.png diff --git a/tests/images/png/pngsuite/xlfn0g04.png b/tests/fileformats/png/pngsuite/xlfn0g04.png similarity index 100% rename from tests/images/png/pngsuite/xlfn0g04.png rename to tests/fileformats/png/pngsuite/xlfn0g04.png diff --git a/tests/images/png/pngsuite/xs1n0g01.png b/tests/fileformats/png/pngsuite/xs1n0g01.png similarity index 100% rename from tests/images/png/pngsuite/xs1n0g01.png rename to tests/fileformats/png/pngsuite/xs1n0g01.png diff --git a/tests/images/png/pngsuite/xs2n0g01.png b/tests/fileformats/png/pngsuite/xs2n0g01.png similarity index 100% rename from tests/images/png/pngsuite/xs2n0g01.png rename to tests/fileformats/png/pngsuite/xs2n0g01.png diff --git a/tests/images/png/pngsuite/xs4n0g01.png b/tests/fileformats/png/pngsuite/xs4n0g01.png similarity index 100% rename from tests/images/png/pngsuite/xs4n0g01.png rename to tests/fileformats/png/pngsuite/xs4n0g01.png diff --git a/tests/images/png/pngsuite/xs7n0g01.png b/tests/fileformats/png/pngsuite/xs7n0g01.png similarity index 100% rename from tests/images/png/pngsuite/xs7n0g01.png rename to tests/fileformats/png/pngsuite/xs7n0g01.png diff --git a/tests/images/png/pngsuite/z00n2c08.png b/tests/fileformats/png/pngsuite/z00n2c08.png similarity index 100% rename from tests/images/png/pngsuite/z00n2c08.png rename to tests/fileformats/png/pngsuite/z00n2c08.png diff --git a/tests/images/png/pngsuite/z03n2c08.png b/tests/fileformats/png/pngsuite/z03n2c08.png similarity index 100% rename from tests/images/png/pngsuite/z03n2c08.png rename to tests/fileformats/png/pngsuite/z03n2c08.png diff --git a/tests/images/png/pngsuite/z06n2c08.png b/tests/fileformats/png/pngsuite/z06n2c08.png similarity index 100% rename from tests/images/png/pngsuite/z06n2c08.png rename to tests/fileformats/png/pngsuite/z06n2c08.png diff --git a/tests/images/png/pngsuite/z09n2c08.png b/tests/fileformats/png/pngsuite/z09n2c08.png similarity index 100% rename from tests/images/png/pngsuite/z09n2c08.png rename to tests/fileformats/png/pngsuite/z09n2c08.png diff --git a/tests/images/png/trailing_data.png b/tests/fileformats/png/trailing_data.png similarity index 100% rename from tests/images/png/trailing_data.png rename to tests/fileformats/png/trailing_data.png diff --git a/tests/images/svg/Ghostscript_Tiger.svg b/tests/fileformats/svg/Ghostscript_Tiger.svg similarity index 100% rename from tests/images/svg/Ghostscript_Tiger.svg rename to tests/fileformats/svg/Ghostscript_Tiger.svg diff --git a/tests/images/svg/circle01.svg b/tests/fileformats/svg/circle01.svg similarity index 100% rename from tests/images/svg/circle01.svg rename to tests/fileformats/svg/circle01.svg diff --git a/tests/images/svg/dashes.svg b/tests/fileformats/svg/dashes.svg similarity index 100% rename from tests/images/svg/dashes.svg rename to tests/fileformats/svg/dashes.svg diff --git a/tests/images/svg/diffs/Ghostscript_Tiger.png b/tests/fileformats/svg/diffs/Ghostscript_Tiger.png similarity index 100% rename from tests/images/svg/diffs/Ghostscript_Tiger.png rename to tests/fileformats/svg/diffs/Ghostscript_Tiger.png diff --git a/tests/images/svg/diffs/circle01.png b/tests/fileformats/svg/diffs/circle01.png similarity index 100% rename from tests/images/svg/diffs/circle01.png rename to tests/fileformats/svg/diffs/circle01.png diff --git a/tests/images/svg/diffs/dashes.png b/tests/fileformats/svg/diffs/dashes.png similarity index 100% rename from tests/images/svg/diffs/dashes.png rename to tests/fileformats/svg/diffs/dashes.png diff --git a/tests/images/svg/diffs/ellipse01.png b/tests/fileformats/svg/diffs/ellipse01.png similarity index 100% rename from tests/images/svg/diffs/ellipse01.png rename to tests/fileformats/svg/diffs/ellipse01.png diff --git a/tests/images/svg/diffs/line01.png b/tests/fileformats/svg/diffs/line01.png similarity index 100% rename from tests/images/svg/diffs/line01.png rename to tests/fileformats/svg/diffs/line01.png diff --git a/tests/images/svg/diffs/miterlimit.png b/tests/fileformats/svg/diffs/miterlimit.png similarity index 100% rename from tests/images/svg/diffs/miterlimit.png rename to tests/fileformats/svg/diffs/miterlimit.png diff --git a/tests/images/svg/diffs/polygon01.png b/tests/fileformats/svg/diffs/polygon01.png similarity index 100% rename from tests/images/svg/diffs/polygon01.png rename to tests/fileformats/svg/diffs/polygon01.png diff --git a/tests/images/svg/diffs/polyline01.png b/tests/fileformats/svg/diffs/polyline01.png similarity index 100% rename from tests/images/svg/diffs/polyline01.png rename to tests/fileformats/svg/diffs/polyline01.png diff --git a/tests/images/svg/diffs/quad01.png b/tests/fileformats/svg/diffs/quad01.png similarity index 100% rename from tests/images/svg/diffs/quad01.png rename to tests/fileformats/svg/diffs/quad01.png diff --git a/tests/images/svg/diffs/rect01.png b/tests/fileformats/svg/diffs/rect01.png similarity index 100% rename from tests/images/svg/diffs/rect01.png rename to tests/fileformats/svg/diffs/rect01.png diff --git a/tests/images/svg/diffs/rect02.png b/tests/fileformats/svg/diffs/rect02.png similarity index 100% rename from tests/images/svg/diffs/rect02.png rename to tests/fileformats/svg/diffs/rect02.png diff --git a/tests/images/svg/diffs/scale.png b/tests/fileformats/svg/diffs/scale.png similarity index 100% rename from tests/images/svg/diffs/scale.png rename to tests/fileformats/svg/diffs/scale.png diff --git a/tests/images/svg/diffs/triangle01.png b/tests/fileformats/svg/diffs/triangle01.png similarity index 100% rename from tests/images/svg/diffs/triangle01.png rename to tests/fileformats/svg/diffs/triangle01.png diff --git a/tests/images/svg/ellipse01.svg b/tests/fileformats/svg/ellipse01.svg similarity index 100% rename from tests/images/svg/ellipse01.svg rename to tests/fileformats/svg/ellipse01.svg diff --git a/tests/images/svg/emojitwo.png b/tests/fileformats/svg/emojitwo.png similarity index 100% rename from tests/images/svg/emojitwo.png rename to tests/fileformats/svg/emojitwo.png diff --git a/tests/images/svg/flat-color-icons.png b/tests/fileformats/svg/flat-color-icons.png similarity index 100% rename from tests/images/svg/flat-color-icons.png rename to tests/fileformats/svg/flat-color-icons.png diff --git a/tests/images/svg/ionicons.png b/tests/fileformats/svg/ionicons.png similarity index 100% rename from tests/images/svg/ionicons.png rename to tests/fileformats/svg/ionicons.png diff --git a/tests/images/svg/line01.svg b/tests/fileformats/svg/line01.svg similarity index 100% rename from tests/images/svg/line01.svg rename to tests/fileformats/svg/line01.svg diff --git a/tests/images/svg/masters/Ghostscript_Tiger.png b/tests/fileformats/svg/masters/Ghostscript_Tiger.png similarity index 100% rename from tests/images/svg/masters/Ghostscript_Tiger.png rename to tests/fileformats/svg/masters/Ghostscript_Tiger.png diff --git a/tests/images/svg/masters/circle01.png b/tests/fileformats/svg/masters/circle01.png similarity index 100% rename from tests/images/svg/masters/circle01.png rename to tests/fileformats/svg/masters/circle01.png diff --git a/tests/images/svg/masters/dashes.png b/tests/fileformats/svg/masters/dashes.png similarity index 100% rename from tests/images/svg/masters/dashes.png rename to tests/fileformats/svg/masters/dashes.png diff --git a/tests/images/svg/masters/ellipse01.png b/tests/fileformats/svg/masters/ellipse01.png similarity index 100% rename from tests/images/svg/masters/ellipse01.png rename to tests/fileformats/svg/masters/ellipse01.png diff --git a/tests/images/svg/masters/line01.png b/tests/fileformats/svg/masters/line01.png similarity index 100% rename from tests/images/svg/masters/line01.png rename to tests/fileformats/svg/masters/line01.png diff --git a/tests/images/svg/masters/miterlimit.png b/tests/fileformats/svg/masters/miterlimit.png similarity index 100% rename from tests/images/svg/masters/miterlimit.png rename to tests/fileformats/svg/masters/miterlimit.png diff --git a/tests/images/svg/masters/polygon01.png b/tests/fileformats/svg/masters/polygon01.png similarity index 100% rename from tests/images/svg/masters/polygon01.png rename to tests/fileformats/svg/masters/polygon01.png diff --git a/tests/images/svg/masters/polyline01.png b/tests/fileformats/svg/masters/polyline01.png similarity index 100% rename from tests/images/svg/masters/polyline01.png rename to tests/fileformats/svg/masters/polyline01.png diff --git a/tests/images/svg/masters/quad01.png b/tests/fileformats/svg/masters/quad01.png similarity index 100% rename from tests/images/svg/masters/quad01.png rename to tests/fileformats/svg/masters/quad01.png diff --git a/tests/images/svg/masters/rect01.png b/tests/fileformats/svg/masters/rect01.png similarity index 100% rename from tests/images/svg/masters/rect01.png rename to tests/fileformats/svg/masters/rect01.png diff --git a/tests/images/svg/masters/rect02.png b/tests/fileformats/svg/masters/rect02.png similarity index 100% rename from tests/images/svg/masters/rect02.png rename to tests/fileformats/svg/masters/rect02.png diff --git a/tests/images/svg/masters/scale.png b/tests/fileformats/svg/masters/scale.png similarity index 100% rename from tests/images/svg/masters/scale.png rename to tests/fileformats/svg/masters/scale.png diff --git a/tests/images/svg/masters/triangle01.png b/tests/fileformats/svg/masters/triangle01.png similarity index 100% rename from tests/images/svg/masters/triangle01.png rename to tests/fileformats/svg/masters/triangle01.png diff --git a/tests/images/svg/miterlimit.svg b/tests/fileformats/svg/miterlimit.svg similarity index 100% rename from tests/images/svg/miterlimit.svg rename to tests/fileformats/svg/miterlimit.svg diff --git a/tests/images/svg/noto-emoji.png b/tests/fileformats/svg/noto-emoji.png similarity index 100% rename from tests/images/svg/noto-emoji.png rename to tests/fileformats/svg/noto-emoji.png diff --git a/tests/images/svg/openmoji.png b/tests/fileformats/svg/openmoji.png similarity index 100% rename from tests/images/svg/openmoji.png rename to tests/fileformats/svg/openmoji.png diff --git a/tests/images/svg/polygon01.svg b/tests/fileformats/svg/polygon01.svg similarity index 100% rename from tests/images/svg/polygon01.svg rename to tests/fileformats/svg/polygon01.svg diff --git a/tests/images/svg/polyline01.svg b/tests/fileformats/svg/polyline01.svg similarity index 100% rename from tests/images/svg/polyline01.svg rename to tests/fileformats/svg/polyline01.svg diff --git a/tests/images/svg/quad01.svg b/tests/fileformats/svg/quad01.svg similarity index 100% rename from tests/images/svg/quad01.svg rename to tests/fileformats/svg/quad01.svg diff --git a/tests/images/svg/rect01.svg b/tests/fileformats/svg/rect01.svg similarity index 100% rename from tests/images/svg/rect01.svg rename to tests/fileformats/svg/rect01.svg diff --git a/tests/images/svg/rect02.svg b/tests/fileformats/svg/rect02.svg similarity index 100% rename from tests/images/svg/rect02.svg rename to tests/fileformats/svg/rect02.svg diff --git a/tests/images/svg/rendered/Ghostscript_Tiger.png b/tests/fileformats/svg/rendered/Ghostscript_Tiger.png similarity index 100% rename from tests/images/svg/rendered/Ghostscript_Tiger.png rename to tests/fileformats/svg/rendered/Ghostscript_Tiger.png diff --git a/tests/images/svg/rendered/circle01.png b/tests/fileformats/svg/rendered/circle01.png similarity index 100% rename from tests/images/svg/rendered/circle01.png rename to tests/fileformats/svg/rendered/circle01.png diff --git a/tests/images/svg/rendered/dashes.png b/tests/fileformats/svg/rendered/dashes.png similarity index 100% rename from tests/images/svg/rendered/dashes.png rename to tests/fileformats/svg/rendered/dashes.png diff --git a/tests/images/svg/rendered/ellipse01.png b/tests/fileformats/svg/rendered/ellipse01.png similarity index 100% rename from tests/images/svg/rendered/ellipse01.png rename to tests/fileformats/svg/rendered/ellipse01.png diff --git a/tests/images/svg/rendered/line01.png b/tests/fileformats/svg/rendered/line01.png similarity index 100% rename from tests/images/svg/rendered/line01.png rename to tests/fileformats/svg/rendered/line01.png diff --git a/tests/images/svg/rendered/miterlimit.png b/tests/fileformats/svg/rendered/miterlimit.png similarity index 100% rename from tests/images/svg/rendered/miterlimit.png rename to tests/fileformats/svg/rendered/miterlimit.png diff --git a/tests/images/svg/rendered/polygon01.png b/tests/fileformats/svg/rendered/polygon01.png similarity index 100% rename from tests/images/svg/rendered/polygon01.png rename to tests/fileformats/svg/rendered/polygon01.png diff --git a/tests/images/svg/rendered/polyline01.png b/tests/fileformats/svg/rendered/polyline01.png similarity index 100% rename from tests/images/svg/rendered/polyline01.png rename to tests/fileformats/svg/rendered/polyline01.png diff --git a/tests/images/svg/rendered/quad01.png b/tests/fileformats/svg/rendered/quad01.png similarity index 100% rename from tests/images/svg/rendered/quad01.png rename to tests/fileformats/svg/rendered/quad01.png diff --git a/tests/images/svg/rendered/rect01.png b/tests/fileformats/svg/rendered/rect01.png similarity index 100% rename from tests/images/svg/rendered/rect01.png rename to tests/fileformats/svg/rendered/rect01.png diff --git a/tests/images/svg/rendered/rect02.png b/tests/fileformats/svg/rendered/rect02.png similarity index 100% rename from tests/images/svg/rendered/rect02.png rename to tests/fileformats/svg/rendered/rect02.png diff --git a/tests/images/svg/rendered/scale.png b/tests/fileformats/svg/rendered/scale.png similarity index 100% rename from tests/images/svg/rendered/scale.png rename to tests/fileformats/svg/rendered/scale.png diff --git a/tests/images/svg/rendered/triangle01.png b/tests/fileformats/svg/rendered/triangle01.png similarity index 100% rename from tests/images/svg/rendered/triangle01.png rename to tests/fileformats/svg/rendered/triangle01.png diff --git a/tests/images/svg/scale.svg b/tests/fileformats/svg/scale.svg similarity index 100% rename from tests/images/svg/scale.svg rename to tests/fileformats/svg/scale.svg diff --git a/tests/images/svg/simple-icons.png b/tests/fileformats/svg/simple-icons.png similarity index 100% rename from tests/images/svg/simple-icons.png rename to tests/fileformats/svg/simple-icons.png diff --git a/tests/images/svg/tabler-icons.png b/tests/fileformats/svg/tabler-icons.png similarity index 100% rename from tests/images/svg/tabler-icons.png rename to tests/fileformats/svg/tabler-icons.png diff --git a/tests/images/svg/triangle01.svg b/tests/fileformats/svg/triangle01.svg similarity index 100% rename from tests/images/svg/triangle01.svg rename to tests/fileformats/svg/triangle01.svg diff --git a/tests/images/svg/twbs-icons.png b/tests/fileformats/svg/twbs-icons.png similarity index 100% rename from tests/images/svg/twbs-icons.png rename to tests/fileformats/svg/twbs-icons.png diff --git a/tests/images/svg/twemoji.png b/tests/fileformats/svg/twemoji.png similarity index 100% rename from tests/images/svg/twemoji.png rename to tests/fileformats/svg/twemoji.png diff --git a/tests/fuzz_gif.nim b/tests/fuzz_gif.nim index 645cde1..0f85fee 100644 --- a/tests/fuzz_gif.nim +++ b/tests/fuzz_gif.nim @@ -2,7 +2,7 @@ import pixie/common, pixie/fileformats/gif, random, strformat randomize() -let original = readFile("tests/images/gif/sunflower.gif") +let original = readFile("tests/fileformats/gif/sunflower.gif") for i in 0 ..< 10_000: var data = original diff --git a/tests/fuzz_jpg.nim b/tests/fuzz_jpg.nim index ea366e7..003b970 100644 --- a/tests/fuzz_jpg.nim +++ b/tests/fuzz_jpg.nim @@ -2,7 +2,7 @@ import pixie/common, pixie/fileformats/jpg, random, strformat randomize() -let original = cast[seq[uint8]](readFile("tests/images/jpg/jpeg420exif.jpg")) +let original = cast[seq[uint8]](readFile("tests/fileformats/jpg/jpeg420exif.jpg")) for i in 0 ..< 10_000: var data = original diff --git a/tests/fuzz_leaks3.nim b/tests/fuzz_leaks3.nim index 7c4949c..1572861 100644 --- a/tests/fuzz_leaks3.nim +++ b/tests/fuzz_leaks3.nim @@ -5,7 +5,7 @@ when not defined(pixieLeakCheck): randomize() -let data = readFile("tests/images/svg/Ghostscript_Tiger.svg") +let data = readFile("tests/fileformats/svg/Ghostscript_Tiger.svg") for i in 0 ..< 100_000: var image = decodeSvg(data, rand(300 .. 1800), rand(30 .. 1800)) diff --git a/tests/fuzz_paths.nim b/tests/fuzz_paths.nim index 8237878..af297ba 100644 --- a/tests/fuzz_paths.nim +++ b/tests/fuzz_paths.nim @@ -12,14 +12,12 @@ for i in 0 ..< 10_000: data[pos] = value echo &"{i} {pos} {value.uint8}" try: - let path = parsePath(data) - doAssert path.commands.len >= 0 + discard parsePath(data) except PixieError: discard data = data[0 ..< pos] try: - let path = parsePath(data) - doAssert path.commands.len >= 0 + discard parsePath(data) except PixieError: discard diff --git a/tests/fuzz_png.nim b/tests/fuzz_png.nim index 631d376..9e10dd9 100644 --- a/tests/fuzz_png.nim +++ b/tests/fuzz_png.nim @@ -4,13 +4,11 @@ randomize() for i in 0 ..< 10_000: let file = pngSuiteFiles[rand(pngSuiteFiles.len - 1)] - var data = cast[seq[uint8]]( - readFile(&"tests/images/png/pngsuite/{file}.png") - ) + var data = readFile(&"tests/fileformats/png/pngsuite/{file}.png") let pos = 29 + rand(data.len - 30) value = rand(255).uint8 - data[pos] = value + data[pos] = value.char echo &"{i} {file} {pos} {value}" try: let img = decodePng(data) diff --git a/tests/fuzz_svg.nim b/tests/fuzz_svg.nim index 7356a18..89a4e75 100644 --- a/tests/fuzz_svg.nim +++ b/tests/fuzz_svg.nim @@ -2,7 +2,7 @@ import pixie/common, pixie/fileformats/svg, random, strformat randomize() -let original = readFile("tests/images/svg/Ghostscript_Tiger.svg") +let original = readFile("tests/fileformats/svg/Ghostscript_Tiger.svg") for i in 0 ..< 10_000: var data = original diff --git a/tests/images/masks/circleMask.png b/tests/masks/circleMask.png similarity index 100% rename from tests/images/masks/circleMask.png rename to tests/masks/circleMask.png diff --git a/tests/images/masks/circleMaskSharpened.png b/tests/masks/circleMaskSharpened.png similarity index 100% rename from tests/images/masks/circleMaskSharpened.png rename to tests/masks/circleMaskSharpened.png diff --git a/tests/images/masks/drawEllipse.png b/tests/masks/drawEllipse.png similarity index 100% rename from tests/images/masks/drawEllipse.png rename to tests/masks/drawEllipse.png diff --git a/tests/images/masks/drawPolygon.png b/tests/masks/drawPolygon.png similarity index 100% rename from tests/images/masks/drawPolygon.png rename to tests/masks/drawPolygon.png diff --git a/tests/images/masks/drawRect.png b/tests/masks/drawRect.png similarity index 100% rename from tests/images/masks/drawRect.png rename to tests/masks/drawRect.png diff --git a/tests/images/masks/drawRoundedRect.png b/tests/masks/drawRoundedRect.png similarity index 100% rename from tests/images/masks/drawRoundedRect.png rename to tests/masks/drawRoundedRect.png diff --git a/tests/images/masks/drawSegment.png b/tests/masks/drawSegment.png similarity index 100% rename from tests/images/masks/drawSegment.png rename to tests/masks/drawSegment.png diff --git a/tests/images/masks/imageMaskedMask.png b/tests/masks/imageMaskedMask.png similarity index 100% rename from tests/images/masks/imageMaskedMask.png rename to tests/masks/imageMaskedMask.png diff --git a/tests/masks/maskMagnified.png b/tests/masks/maskMagnified.png new file mode 100644 index 0000000..d2c9e78 Binary files /dev/null and b/tests/masks/maskMagnified.png differ diff --git a/tests/images/masks/maskMinified.png b/tests/masks/maskMinified.png similarity index 100% rename from tests/images/masks/maskMinified.png rename to tests/masks/maskMinified.png diff --git a/tests/images/masks/maskedMask.png b/tests/masks/maskedMask.png similarity index 100% rename from tests/images/masks/maskedMask.png rename to tests/masks/maskedMask.png diff --git a/tests/images/masks/minifiedBlur.png b/tests/masks/minifiedBlur.png similarity index 100% rename from tests/images/masks/minifiedBlur.png rename to tests/masks/minifiedBlur.png diff --git a/tests/images/masks/spread.png b/tests/masks/spread.png similarity index 100% rename from tests/images/masks/spread.png rename to tests/masks/spread.png diff --git a/tests/images/masks/strokeEllipse.png b/tests/masks/strokeEllipse.png similarity index 100% rename from tests/images/masks/strokeEllipse.png rename to tests/masks/strokeEllipse.png diff --git a/tests/images/masks/strokePolygon.png b/tests/masks/strokePolygon.png similarity index 100% rename from tests/images/masks/strokePolygon.png rename to tests/masks/strokePolygon.png diff --git a/tests/images/masks/strokeRect.png b/tests/masks/strokeRect.png similarity index 100% rename from tests/images/masks/strokeRect.png rename to tests/masks/strokeRect.png diff --git a/tests/images/masks/strokeRoundedRect.png b/tests/masks/strokeRoundedRect.png similarity index 100% rename from tests/images/masks/strokeRoundedRect.png rename to tests/masks/strokeRoundedRect.png diff --git a/tests/megatest_emoji.nim b/tests/megatest_emoji.nim index a1cf63a..7e66509 100644 --- a/tests/megatest_emoji.nim +++ b/tests/megatest_emoji.nim @@ -57,7 +57,7 @@ proc renderEmojiSet(index: int) = bmOverwrite ) - rendered.writeFile(&"tests/images/svg/{emojiSet.name}.png") + rendered.writeFile(&"tests/fileformats/svg/{emojiSet.name}.png") proc main(index = -1) = if index >= 0: diff --git a/tests/megatest_icons.nim b/tests/megatest_icons.nim index a1e6a59..7a94b7e 100644 --- a/tests/megatest_icons.nim +++ b/tests/megatest_icons.nim @@ -58,7 +58,7 @@ proc renderIconSet(index: int) = bmOverwrite ) - rendered.writeFile(&"tests/images/svg/{iconSet.name}.png") + rendered.writeFile(&"tests/fileformats/svg/{iconSet.name}.png") proc main(index = -1) = if index >= 0: diff --git a/tests/images/paths/arc.png b/tests/paths/arc.png similarity index 100% rename from tests/images/paths/arc.png rename to tests/paths/arc.png diff --git a/tests/images/paths/arcTo1.png b/tests/paths/arcTo1.png similarity index 100% rename from tests/images/paths/arcTo1.png rename to tests/paths/arcTo1.png diff --git a/tests/images/paths/arcTo2.png b/tests/paths/arcTo2.png similarity index 100% rename from tests/images/paths/arcTo2.png rename to tests/paths/arcTo2.png diff --git a/tests/images/paths/arcTo3.png b/tests/paths/arcTo3.png similarity index 100% rename from tests/images/paths/arcTo3.png rename to tests/paths/arcTo3.png diff --git a/tests/images/paths/boxBevel.png b/tests/paths/boxBevel.png similarity index 100% rename from tests/images/paths/boxBevel.png rename to tests/paths/boxBevel.png diff --git a/tests/images/paths/boxMiter.png b/tests/paths/boxMiter.png similarity index 100% rename from tests/images/paths/boxMiter.png rename to tests/paths/boxMiter.png diff --git a/tests/images/paths/boxRound.png b/tests/paths/boxRound.png similarity index 100% rename from tests/images/paths/boxRound.png rename to tests/paths/boxRound.png diff --git a/tests/images/paths/dashes.png b/tests/paths/dashes.png similarity index 100% rename from tests/images/paths/dashes.png rename to tests/paths/dashes.png diff --git a/tests/images/paths/gradientAngular.png b/tests/paths/gradientAngular.png similarity index 100% rename from tests/images/paths/gradientAngular.png rename to tests/paths/gradientAngular.png diff --git a/tests/images/paths/gradientAngularOpacity.png b/tests/paths/gradientAngularOpacity.png similarity index 100% rename from tests/images/paths/gradientAngularOpacity.png rename to tests/paths/gradientAngularOpacity.png diff --git a/tests/images/paths/gradientLinear.png b/tests/paths/gradientLinear.png similarity index 100% rename from tests/images/paths/gradientLinear.png rename to tests/paths/gradientLinear.png diff --git a/tests/images/paths/gradientRadial.png b/tests/paths/gradientRadial.png similarity index 100% rename from tests/images/paths/gradientRadial.png rename to tests/paths/gradientRadial.png diff --git a/tests/images/paths/lcButt.png b/tests/paths/lcButt.png similarity index 100% rename from tests/images/paths/lcButt.png rename to tests/paths/lcButt.png diff --git a/tests/images/paths/lcRound.png b/tests/paths/lcRound.png similarity index 100% rename from tests/images/paths/lcRound.png rename to tests/paths/lcRound.png diff --git a/tests/images/paths/lcSquare.png b/tests/paths/lcSquare.png similarity index 100% rename from tests/images/paths/lcSquare.png rename to tests/paths/lcSquare.png diff --git a/tests/images/paths/maskRectExcludeMask.png b/tests/paths/maskRectExcludeMask.png similarity index 100% rename from tests/images/paths/maskRectExcludeMask.png rename to tests/paths/maskRectExcludeMask.png diff --git a/tests/images/paths/maskRectExcludeMaskAA.png b/tests/paths/maskRectExcludeMaskAA.png similarity index 100% rename from tests/images/paths/maskRectExcludeMaskAA.png rename to tests/paths/maskRectExcludeMaskAA.png diff --git a/tests/images/paths/maskRectMask.png b/tests/paths/maskRectMask.png similarity index 100% rename from tests/images/paths/maskRectMask.png rename to tests/paths/maskRectMask.png diff --git a/tests/images/paths/maskRectMaskAA.png b/tests/paths/maskRectMaskAA.png similarity index 100% rename from tests/images/paths/maskRectMaskAA.png rename to tests/paths/maskRectMaskAA.png diff --git a/tests/images/paths/miterLimit_10deg_2.00num.png b/tests/paths/miterLimit_10deg_2.00num.png similarity index 100% rename from tests/images/paths/miterLimit_10deg_2.00num.png rename to tests/paths/miterLimit_10deg_2.00num.png diff --git a/tests/images/paths/miterLimit_145deg_2.00num.png b/tests/paths/miterLimit_145deg_2.00num.png similarity index 100% rename from tests/images/paths/miterLimit_145deg_2.00num.png rename to tests/paths/miterLimit_145deg_2.00num.png diff --git a/tests/images/paths/miterLimit_145deg_3.32num.png b/tests/paths/miterLimit_145deg_3.32num.png similarity index 100% rename from tests/images/paths/miterLimit_145deg_3.32num.png rename to tests/paths/miterLimit_145deg_3.32num.png diff --git a/tests/images/paths/miterLimit_145deg_3.33num.png b/tests/paths/miterLimit_145deg_3.33num.png similarity index 100% rename from tests/images/paths/miterLimit_145deg_3.33num.png rename to tests/paths/miterLimit_145deg_3.33num.png diff --git a/tests/images/paths/miterLimit_155deg_2.00num.png b/tests/paths/miterLimit_155deg_2.00num.png similarity index 100% rename from tests/images/paths/miterLimit_155deg_2.00num.png rename to tests/paths/miterLimit_155deg_2.00num.png diff --git a/tests/images/paths/miterLimit_165deg_10.00num.png b/tests/paths/miterLimit_165deg_10.00num.png similarity index 100% rename from tests/images/paths/miterLimit_165deg_10.00num.png rename to tests/paths/miterLimit_165deg_10.00num.png diff --git a/tests/images/paths/miterLimit_165deg_2.00num.png b/tests/paths/miterLimit_165deg_2.00num.png similarity index 100% rename from tests/images/paths/miterLimit_165deg_2.00num.png rename to tests/paths/miterLimit_165deg_2.00num.png diff --git a/tests/images/paths/opacityFill.png b/tests/paths/opacityFill.png similarity index 100% rename from tests/images/paths/opacityFill.png rename to tests/paths/opacityFill.png diff --git a/tests/images/paths/opacityStroke.png b/tests/paths/opacityStroke.png similarity index 100% rename from tests/images/paths/opacityStroke.png rename to tests/paths/opacityStroke.png diff --git a/tests/images/paths/paintImage.png b/tests/paths/paintImage.png similarity index 100% rename from tests/images/paths/paintImage.png rename to tests/paths/paintImage.png diff --git a/tests/images/paths/paintImageOpacity.png b/tests/paths/paintImageOpacity.png similarity index 100% rename from tests/images/paths/paintImageOpacity.png rename to tests/paths/paintImageOpacity.png diff --git a/tests/images/paths/paintImageTiled.png b/tests/paths/paintImageTiled.png similarity index 100% rename from tests/images/paths/paintImageTiled.png rename to tests/paths/paintImageTiled.png diff --git a/tests/images/paths/paintImageTiledOpacity.png b/tests/paths/paintImageTiledOpacity.png similarity index 100% rename from tests/images/paths/paintImageTiledOpacity.png rename to tests/paths/paintImageTiledOpacity.png diff --git a/tests/images/paths/paintSolid.png b/tests/paths/paintSolid.png similarity index 100% rename from tests/images/paths/paintSolid.png rename to tests/paths/paintSolid.png diff --git a/tests/images/paths/pathBlackRectangle.png b/tests/paths/pathBlackRectangle.png similarity index 100% rename from tests/images/paths/pathBlackRectangle.png rename to tests/paths/pathBlackRectangle.png diff --git a/tests/images/paths/pathBlackRectangleZ.png b/tests/paths/pathBlackRectangleZ.png similarity index 100% rename from tests/images/paths/pathBlackRectangleZ.png rename to tests/paths/pathBlackRectangleZ.png diff --git a/tests/images/paths/pathBottomArc.png b/tests/paths/pathBottomArc.png similarity index 100% rename from tests/images/paths/pathBottomArc.png rename to tests/paths/pathBottomArc.png diff --git a/tests/images/paths/pathCornerArc.png b/tests/paths/pathCornerArc.png similarity index 100% rename from tests/images/paths/pathCornerArc.png rename to tests/paths/pathCornerArc.png diff --git a/tests/images/paths/pathHeart.png b/tests/paths/pathHeart.png similarity index 100% rename from tests/images/paths/pathHeart.png rename to tests/paths/pathHeart.png diff --git a/tests/images/paths/pathInvertedCornerArc.png b/tests/paths/pathInvertedCornerArc.png similarity index 100% rename from tests/images/paths/pathInvertedCornerArc.png rename to tests/paths/pathInvertedCornerArc.png diff --git a/tests/images/paths/pathRectangleMask.png b/tests/paths/pathRectangleMask.png similarity index 100% rename from tests/images/paths/pathRectangleMask.png rename to tests/paths/pathRectangleMask.png diff --git a/tests/images/paths/pathRedRectangle.png b/tests/paths/pathRedRectangle.png similarity index 100% rename from tests/images/paths/pathRedRectangle.png rename to tests/paths/pathRedRectangle.png diff --git a/tests/images/paths/pathRotatedArc.png b/tests/paths/pathRotatedArc.png similarity index 100% rename from tests/images/paths/pathRotatedArc.png rename to tests/paths/pathRotatedArc.png diff --git a/tests/images/paths/pathRoundRect.png b/tests/paths/pathRoundRect.png similarity index 100% rename from tests/images/paths/pathRoundRect.png rename to tests/paths/pathRoundRect.png diff --git a/tests/images/paths/pathRoundRectMask.png b/tests/paths/pathRoundRectMask.png similarity index 100% rename from tests/images/paths/pathRoundRectMask.png rename to tests/paths/pathRoundRectMask.png diff --git a/tests/images/paths/pathStroke1.png b/tests/paths/pathStroke1.png similarity index 100% rename from tests/images/paths/pathStroke1.png rename to tests/paths/pathStroke1.png diff --git a/tests/images/paths/pathStroke2.png b/tests/paths/pathStroke2.png similarity index 100% rename from tests/images/paths/pathStroke2.png rename to tests/paths/pathStroke2.png diff --git a/tests/images/paths/pathStroke3.png b/tests/paths/pathStroke3.png similarity index 100% rename from tests/images/paths/pathStroke3.png rename to tests/paths/pathStroke3.png diff --git a/tests/images/paths/pathYellowRectangle.png b/tests/paths/pathYellowRectangle.png similarity index 100% rename from tests/images/paths/pathYellowRectangle.png rename to tests/paths/pathYellowRectangle.png diff --git a/tests/images/paths/pixelScale.png b/tests/paths/pixelScale.png similarity index 100% rename from tests/images/paths/pixelScale.png rename to tests/paths/pixelScale.png diff --git a/tests/images/paths/rectExcludeMask.png b/tests/paths/rectExcludeMask.png similarity index 100% rename from tests/images/paths/rectExcludeMask.png rename to tests/paths/rectExcludeMask.png diff --git a/tests/images/paths/rectExcludeMaskAA.png b/tests/paths/rectExcludeMaskAA.png similarity index 100% rename from tests/images/paths/rectExcludeMaskAA.png rename to tests/paths/rectExcludeMaskAA.png diff --git a/tests/images/paths/rectMask.png b/tests/paths/rectMask.png similarity index 100% rename from tests/images/paths/rectMask.png rename to tests/paths/rectMask.png diff --git a/tests/images/paths/rectMaskAA.png b/tests/paths/rectMaskAA.png similarity index 100% rename from tests/images/paths/rectMaskAA.png rename to tests/paths/rectMaskAA.png diff --git a/tests/images/paths/selfclosing.png b/tests/paths/selfclosing.png similarity index 100% rename from tests/images/paths/selfclosing.png rename to tests/paths/selfclosing.png diff --git a/tests/test_bmp.nim b/tests/test_bmp.nim index 5d19d31..40080fe 100644 --- a/tests/test_bmp.nim +++ b/tests/test_bmp.nim @@ -13,7 +13,7 @@ import chroma, pixie, pixie/fileformats/bmp # image[2, 1] = rgba(255, 0, 0, 127) # image[3, 1] = rgba(255, 255, 255, 127) -# writeFile("tests/images/bmp/test4x2.bmp", encodeBmp(image)) +# writeFile("tests/fileformats/bmp/test4x2.bmp", encodeBmp(image)) # var image2 = decodeBmp(encodeBmp(image)) # doAssert image2.width == image.width @@ -23,7 +23,7 @@ import chroma, pixie, pixie/fileformats/bmp # block: # var image = newImage(16, 16) # image.fill(rgba(255, 0, 0, 127)) -# writeFile("tests/images/bmp/test16x16.bmp", encodeBmp(image)) +# writeFile("tests/fileformats/bmp/test16x16.bmp", encodeBmp(image)) # var image2 = decodeBmp(encodeBmp(image)) # doAssert image2.width == image.width @@ -33,5 +33,5 @@ import chroma, pixie, pixie/fileformats/bmp block: for bits in [32, 24]: let image = - decodeBmp(readFile("tests/images/bmp/knight." & $bits & ".master.bmp")) - writeFile("tests/images/bmp/knight." & $bits & ".bmp", encodeBmp(image)) + decodeBmp(readFile("tests/fileformats/bmp/knight." & $bits & ".master.bmp")) + writeFile("tests/fileformats/bmp/knight." & $bits & ".bmp", encodeBmp(image)) diff --git a/tests/test_contexts.nim b/tests/test_contexts.nim index b60042b..c09eeb9 100644 --- a/tests/test_contexts.nim +++ b/tests/test_contexts.nim @@ -17,7 +17,7 @@ block: ctx.clearRect(10, 10, 120, 100) - ctx.image.writeFile("tests/images/context/clearRect_1.png") + ctx.image.writeFile("tests/contexts/clearRect_1.png") block: let ctx = newContext(newImage(300, 150)) @@ -34,7 +34,7 @@ block: ctx.lineTo(120, 120) ctx.stroke() - ctx.image.writeFile("tests/images/context/beginPath_1.png") + ctx.image.writeFile("tests/contexts/beginPath_1.png") block: let ctx = newContext(newImage(300, 150)) @@ -46,7 +46,7 @@ block: ctx.lineTo(280, 120) ctx.stroke() - ctx.image.writeFile("tests/images/context/moveTo_1.png") + ctx.image.writeFile("tests/contexts/moveTo_1.png") block: let ctx = newContext(newImage(300, 150)) @@ -63,7 +63,7 @@ block: ctx.fillStyle = "green" ctx.fill(region, wrEvenOdd) - ctx.image.writeFile("tests/images/context/fill_1.png") + ctx.image.writeFile("tests/contexts/fill_1.png") block: let ctx = newContext(newImage(300, 150)) @@ -71,7 +71,7 @@ block: ctx.rect(10, 10, 150, 100) ctx.stroke() - ctx.image.writeFile("tests/images/context/stroke_1.png") + ctx.image.writeFile("tests/contexts/stroke_1.png") block: let ctx = newContext(newImage(300, 150)) @@ -94,7 +94,7 @@ block: ctx.lineTo(280, 140) ctx.stroke() - ctx.image.writeFile("tests/images/context/stroke_2.png") + ctx.image.writeFile("tests/contexts/stroke_2.png") block: let ctx = newContext(newImage(300, 150)) @@ -112,7 +112,7 @@ block: ctx.stroke() ctx.fill() - ctx.image.writeFile("tests/images/context/stroke_3.png") + ctx.image.writeFile("tests/contexts/stroke_3.png") block: let ctx = newContext(newImage(300, 150)) @@ -124,7 +124,7 @@ block: ctx.closePath() ctx.stroke() - ctx.image.writeFile("tests/images/context/closePath_1.png") + ctx.image.writeFile("tests/contexts/closePath_1.png") block: let ctx = newContext(newImage(300, 150)) @@ -140,7 +140,7 @@ block: ctx.bezierCurveTo(cp1, cp2, to) ctx.stroke() - ctx.image.writeFile("tests/images/context/bezierCurveTo_1.png") + ctx.image.writeFile("tests/contexts/bezierCurveTo_1.png") block: let ctx = newContext(newImage(300, 150)) @@ -150,7 +150,7 @@ block: ctx.bezierCurveTo(120, 160, 180, 10, 220, 140) ctx.stroke() - ctx.image.writeFile("tests/images/context/bezierCurveTo_2.png") + ctx.image.writeFile("tests/contexts/bezierCurveTo_2.png") block: let ctx = newContext(newImage(300, 150)) @@ -159,7 +159,7 @@ block: ctx.quadraticCurveTo(230, 30, 50, 100) ctx.stroke() - ctx.image.writeFile("tests/images/context/quadracticCurveTo_1.png") + ctx.image.writeFile("tests/contexts/quadracticCurveTo_1.png") block: let ctx = newContext(newImage(300, 150)) @@ -169,7 +169,7 @@ block: ctx.quadraticCurveTo(230, 150, 250, 20) ctx.stroke() - ctx.image.writeFile("tests/images/context/quadracticCurveTo_2.png") + ctx.image.writeFile("tests/contexts/quadracticCurveTo_2.png") block: let ctx = newContext(newImage(300, 150)) @@ -178,7 +178,7 @@ block: ctx.ellipse(100, 75, 75, 50) ctx.stroke() - ctx.image.writeFile("tests/images/context/ellipse_1.png") + ctx.image.writeFile("tests/contexts/ellipse_1.png") block: let ctx = newContext(newImage(300, 150)) @@ -186,7 +186,7 @@ block: ctx.strokeStyle = "green" ctx.strokeRect(20, 10, 160, 100) - ctx.image.writeFile("tests/images/context/strokeRect_1.png") + ctx.image.writeFile("tests/contexts/strokeRect_1.png") block: let ctx = newContext(newImage(300, 150)) @@ -196,7 +196,7 @@ block: ctx.strokeStyle = "#38f" ctx.strokeRect(30, 30, 160, 90) - ctx.image.writeFile("tests/images/context/strokeRect_2.png") + ctx.image.writeFile("tests/contexts/strokeRect_2.png") block: let ctx = newContext(newImage(300, 150)) @@ -204,7 +204,7 @@ block: ctx.setTransform(mat3(1, 0.2, 0, 0.8, 1, 0, 0, 0, 1)) ctx.fillRect(0, 0, 100, 100) - ctx.image.writeFile("tests/images/context/setTransform_1.png") + ctx.image.writeFile("tests/contexts/setTransform_1.png") block: let ctx = newContext(newImage(300, 150)) @@ -212,7 +212,7 @@ block: ctx.setTransform(mat3(1, 0.2, 0, 0.8, 1, 0, 0, 0, 1)) ctx.fillRect(0, 0, 100, 100) - ctx.image.writeFile("tests/images/context/resetTransform_1.png") + ctx.image.writeFile("tests/contexts/resetTransform_1.png") block: let ctx = newContext(newImage(300, 150)) @@ -220,7 +220,7 @@ block: ctx.rotate(45 * PI / 180) ctx.fillRect(60, 0, 100, 30) - ctx.image.writeFile("tests/images/context/resetTransform_1.png") + ctx.image.writeFile("tests/contexts/resetTransform_1.png") block: let ctx = newContext(newImage(300, 150)) @@ -235,7 +235,7 @@ block: ctx.fillRect(40, 40, 50, 20) ctx.fillRect(40, 90, 50, 20) - ctx.image.writeFile("tests/images/context/resetTransform_2.png") + ctx.image.writeFile("tests/contexts/resetTransform_2.png") block: let ctx = newContext(newImage(300, 150)) @@ -249,7 +249,7 @@ block: ctx.fillStyle = "gray" ctx.fillRect(0, 0, 80, 80) - ctx.image.writeFile("tests/images/context/translate_1.png") + ctx.image.writeFile("tests/contexts/translate_1.png") block: let ctx = newContext(newImage(300, 150)) @@ -263,7 +263,7 @@ block: ctx.fillStyle = "gray" ctx.fillRect(10, 10, 8, 20) - ctx.image.writeFile("tests/images/context/scale_1.png") + ctx.image.writeFile("tests/contexts/scale_1.png") block: let ctx = newContext(newImage(300, 150)) @@ -275,7 +275,7 @@ block: ctx.fillStyle = "red" ctx.fillRect(100, 0, 80, 20) - ctx.image.writeFile("tests/images/context/rotate_1.png") + ctx.image.writeFile("tests/contexts/rotate_1.png") block: let ctx = newContext(newImage(300, 150)) @@ -288,7 +288,7 @@ block: ctx.fillText("Hello world", 50, 90) - ctx.image.writeFile("tests/images/context/fillText_1.png") + ctx.image.writeFile("tests/contexts/fillText_1.png") block: let ctx = newContext(newImage(300, 150)) @@ -298,7 +298,7 @@ block: ctx.strokeText("Hello world", 50, 90) - ctx.image.writeFile("tests/images/context/strokeText_1.png") + ctx.image.writeFile("tests/contexts/strokeText_1.png") block: let ctx = newContext(newImage(300, 150)) @@ -312,7 +312,7 @@ block: ctx.fillRect(150, 40, 100, 100) - ctx.image.writeFile("tests/images/context/save_1.png") + ctx.image.writeFile("tests/contexts/save_1.png") block: let ctx = newContext(newImage(300, 150)) @@ -326,7 +326,7 @@ block: ctx.fillStyle = "orange" ctx.fillRect(0, 0, 100, 100) - ctx.image.writeFile("tests/images/context/clip_1.png") + ctx.image.writeFile("tests/contexts/clip_1.png") block: let ctx = newContext(newImage(300, 150)) @@ -343,7 +343,7 @@ block: ctx.fillStyle = "orange" ctx.fillRect(0, 0, 100, 100) - ctx.image.writeFile("tests/images/context/clip_1b.png") + ctx.image.writeFile("tests/contexts/clip_1b.png") block: let ctx = newContext(newImage(300, 150)) @@ -364,7 +364,7 @@ block: ctx.fillStyle = "blue" ctx.fillRect(0, 0, ctx.image.width.float32, ctx.image.height.float32) - ctx.image.writeFile("tests/images/context/clip_1c.png") + ctx.image.writeFile("tests/contexts/clip_1c.png") block: let ctx = newContext(newImage(300, 150)) @@ -385,7 +385,7 @@ block: ctx.restore() - ctx.image.writeFile("tests/images/context/clip_1d.png") + ctx.image.writeFile("tests/contexts/clip_1d.png") block: let ctx = newContext(newImage(300, 150)) @@ -409,7 +409,7 @@ block: ctx.fillStyle = "blue" ctx.fillRect(0, 0, ctx.image.width.float32, ctx.image.height.float32) - ctx.image.writeFile("tests/images/context/clip_1e.png") + ctx.image.writeFile("tests/contexts/clip_1e.png") block: let ctx = newContext(newImage(300, 150)) @@ -433,7 +433,7 @@ block: ctx.restore() # Pop the layer - ctx.image.writeFile("tests/images/context/clip_1f.png") + ctx.image.writeFile("tests/contexts/clip_1f.png") block: let ctx = newContext(newImage(300, 150)) @@ -446,7 +446,7 @@ block: ctx.fillStyle = "blue" ctx.fillRect(0, 0, ctx.image.width.float32, ctx.image.height.float32) - ctx.image.writeFile("tests/images/context/clip_2.png") + ctx.image.writeFile("tests/contexts/clip_2.png") block: let image = newImage(300, 150) @@ -464,7 +464,7 @@ block: ctx.fillStyle = "blue" ctx.fillRect(0, 0, ctx.image.width.float32, ctx.image.height.float32) - image.writeFile("tests/images/context/clip_3.png") + image.writeFile("tests/contexts/clip_3.png") block: let image = newImage(300, 150) @@ -485,7 +485,7 @@ block: ctx.restore() - image.writeFile("tests/images/context/clip_text.png") + image.writeFile("tests/contexts/clip_text.png") block: let ctx = newContext(100, 100) @@ -517,7 +517,7 @@ block: drawDashedLine(@[20.float32, 3, 3, 3, 3, 3, 3, 3]) drawDashedLine(@[12.float32, 3, 3]) - image.writeFile("tests/images/context/setLineDash_1.png") + image.writeFile("tests/contexts/setLineDash_1.png") block: let @@ -534,7 +534,7 @@ block: ctx.fillRect(10, 10, 100, 100) - image.writeFile("tests/images/context/blendmode_1.png") + image.writeFile("tests/contexts/blendmode_1.png") block: let @@ -551,7 +551,7 @@ block: ctx.fillStyle = "red" ctx.fillRect(50, 50, 100, 100) - image.writeFile("tests/images/context/globalAlpha_1.png") + image.writeFile("tests/contexts/globalAlpha_1.png") block: let @@ -560,7 +560,7 @@ block: testImage = readImage("tests/images/pip1.png") ctx.drawImage(testImage, 0, 0) ctx.drawImage(testImage, 30, 30) - image.writeFile("tests/images/context/draw_image.png") + image.writeFile("tests/contexts/draw_image.png") block: let @@ -570,7 +570,7 @@ block: ctx.translate(30, 30) ctx.drawImage(testImage, -30, -30) ctx.drawImage(testImage, 0, 0) - image.writeFile("tests/images/context/draw_image_translated.png") + image.writeFile("tests/contexts/draw_image_translated.png") block: let @@ -581,7 +581,7 @@ block: ctx.drawImage(testImage, 0, 0) ctx.scale(0.25, 0.25) ctx.drawImage(testImage, 0, 0) - image.writeFile("tests/images/context/draw_image_scaled.png") + image.writeFile("tests/contexts/draw_image_scaled.png") block: let @@ -589,7 +589,7 @@ block: ctx = newContext(image) testImage = readImage("tests/images/pip1.png") ctx.drawImage(testImage, 30, 30, 20, 20) - image.writeFile("tests/images/context/draw_image_self_scaled.png") + image.writeFile("tests/contexts/draw_image_self_scaled.png") block: let @@ -597,7 +597,7 @@ block: ctx = newContext(image) rhino = readImage("tests/images/rhino.png") ctx.drawImage(rhino, 33, 71, 104, 124, 21, 20, 87, 104) - image.writeFile("tests/images/context/draw_image_rhino.png") + image.writeFile("tests/contexts/draw_image_rhino.png") block: let @@ -605,7 +605,7 @@ block: ctx = newContext(image) rhino = readImage("tests/images/rhino.png") ctx.drawImage(rhino, rect(33, 71, 104, 124), rect(21, 20, 87, 104)) - image.writeFile("tests/images/context/draw_image_rhino2.png") + image.writeFile("tests/contexts/draw_image_rhino2.png") block: let @@ -643,4 +643,4 @@ block: ctx.fillStyle.color = color(0, 0, 1, 1) ctx.restore() ctx.fillRect(0, 0, ctx.image.width.float32, ctx.image.height.float32) - ctx.image.writeFile("tests/images/context/paintSaveRestore.png") + ctx.image.writeFile("tests/contexts/paintSaveRestore.png") diff --git a/tests/test_gif.nim b/tests/test_gif.nim index 409ab6f..ceb811b 100644 --- a/tests/test_gif.nim +++ b/tests/test_gif.nim @@ -1,13 +1,13 @@ import pixie, pixie/fileformats/gif -var img = decodeGIF(readFile("tests/images/gif/3x5.gif")) -img.writeFile("tests/images/gif/3x5.png") +var img = decodeGIF(readFile("tests/fileformats/gif/3x5.gif")) +img.writeFile("tests/fileformats/gif/3x5.png") -var img2 = decodeGIF(readFile("tests/images/gif/audrey.gif")) -img2.writeFile("tests/images/gif/audrey.png") +var img2 = decodeGIF(readFile("tests/fileformats/gif/audrey.gif")) +img2.writeFile("tests/fileformats/gif/audrey.png") -var img3 = decodeGIF(readFile("tests/images/gif/sunflower.gif")) -img3.writeFile("tests/images/gif/sunflower.png") +var img3 = decodeGIF(readFile("tests/fileformats/gif/sunflower.gif")) +img3.writeFile("tests/fileformats/gif/sunflower.png") -var img4 = readImage("tests/images/gif/sunflower.gif") +var img4 = readImage("tests/fileformats/gif/sunflower.gif") doAssert img3.data == img4.data diff --git a/tests/test_images.nim b/tests/test_images.nim index 74e1a63..92530fd 100644 --- a/tests/test_images.nim +++ b/tests/test_images.nim @@ -43,7 +43,7 @@ block: a.fill(rgba(255, 0, 0, 255)) b.fill(rgba(0, 255, 0, 255)) - a.draw(b, translate(vec2(0, 0))) + a.draw(b) a.writeFile("tests/images/flipped1.png") a.flipVertical() @@ -113,7 +113,7 @@ block: block: let - a = readImage("tests/images/png/baboon.png") + a = readImage("tests/fileformats/png/baboon.png") b = a.minifyBy2() b.writeFile("tests/images/minifiedBaboon.png") diff --git a/tests/test_masks.nim b/tests/test_masks.nim index 54e2737..6f9bccc 100644 --- a/tests/test_masks.nim +++ b/tests/test_masks.nim @@ -34,7 +34,13 @@ block: doAssert minified.width == 50 and minified.height == 50 - writeFile("tests/images/masks/maskMinified.png", minified.encodePng()) + writeFile("tests/masks/maskMinified.png", minified.encodePng()) + +block: + let + a = readImage("tests/masks/maskMinified.png") + b = a.magnifyBy2() + b.writeFile("tests/masks/maskMagnified.png") block: let image = newImage(100, 100) @@ -47,7 +53,7 @@ block: mask.fillPath(path) image.draw(mask) - image.writeFile("tests/images/masks/circleMask.png") + image.writeFile("tests/masks/circleMask.png") block: let a = newMask(100, 100) @@ -60,7 +66,7 @@ block: b.fillPath(path) a.draw(b) - writeFile("tests/images/masks/maskedMask.png", a.encodePng()) + writeFile("tests/masks/maskedMask.png", a.encodePng()) block: let a = newMask(100, 100) @@ -73,7 +79,7 @@ block: b.fillPath(path, rgba(0, 0, 0, 255)) a.draw(b) - writeFile("tests/images/masks/imageMaskedMask.png", a.encodePng()) + writeFile("tests/masks/imageMaskedMask.png", a.encodePng()) block: let path = newPath() @@ -84,7 +90,7 @@ block: a.spread(10) - writeFile("tests/images/masks/spread.png", a.encodePng()) + writeFile("tests/masks/spread.png", a.encodePng()) block: let mask = newMask(100, 100) @@ -95,7 +101,7 @@ block: mask.fillPath(path) mask.ceil() - writeFile("tests/images/masks/circleMaskSharpened.png", mask.encodePng()) + writeFile("tests/masks/circleMaskSharpened.png", mask.encodePng()) block: let path = newPath() @@ -103,7 +109,7 @@ block: let mask = newMask(100, 100) mask.fillPath(path) - writeFile("tests/images/masks/drawRect.png", mask.encodePng()) + writeFile("tests/masks/drawRect.png", mask.encodePng()) block: let path = newPath() @@ -111,7 +117,7 @@ block: let mask = newMask(100, 100) mask.strokePath(path, strokeWidth = 10) - writeFile("tests/images/masks/strokeRect.png", mask.encodePng()) + writeFile("tests/masks/strokeRect.png", mask.encodePng()) block: let path = newPath() @@ -119,14 +125,14 @@ block: let mask = newMask(100, 100) mask.fillPath(path) - writeFile("tests/images/masks/drawRoundedRect.png", mask.encodePng()) + writeFile("tests/masks/drawRoundedRect.png", mask.encodePng()) block: let path = newPath() path.roundedRect(rect(vec2(10, 10), vec2(30, 30)), 10, 10, 10, 10) let mask = newMask(100, 100) mask.strokePath(path, strokeWidth = 10) - writeFile("tests/images/masks/strokeRoundedRect.png", mask.encodePng()) + writeFile("tests/masks/strokeRoundedRect.png", mask.encodePng()) block: let path = newPath() @@ -135,7 +141,7 @@ block: let mask = newMask(100, 100) mask.strokePath(path, strokeWidth = 10) - writeFile("tests/images/masks/drawSegment.png", mask.encodePng()) + writeFile("tests/masks/drawSegment.png", mask.encodePng()) block: let path = newPath() @@ -143,7 +149,7 @@ block: let mask = newMask(100, 100) mask.fillPath(path) - writeFile("tests/images/masks/drawEllipse.png", mask.encodePng()) + writeFile("tests/masks/drawEllipse.png", mask.encodePng()) block: let path = newPath() @@ -151,7 +157,7 @@ block: let mask = newMask(100, 100) mask.strokePath(path, strokeWidth = 10) - writeFile("tests/images/masks/strokeEllipse.png", mask.encodePng()) + writeFile("tests/masks/strokeEllipse.png", mask.encodePng()) block: let path = newPath() @@ -159,7 +165,7 @@ block: let mask = newMask(100, 100) mask.fillPath(path) - writeFile("tests/images/masks/drawPolygon.png", mask.encodePng()) + writeFile("tests/masks/drawPolygon.png", mask.encodePng()) block: let path = newPath() @@ -167,7 +173,7 @@ block: let mask = newMask(100, 100) mask.strokepath(path, strokeWidth = 10) - writeFile("tests/images/masks/strokePolygon.png", mask.encodePng()) + writeFile("tests/masks/strokePolygon.png", mask.encodePng()) block: let path = newPath() @@ -187,4 +193,4 @@ block: mask.blur(25) let minified = mask.minifyBy2() - writeFile("tests/images/masks/minifiedBlur.png", minified.encodePng()) + writeFile("tests/masks/minifiedBlur.png", minified.encodePng()) diff --git a/tests/test_paints.nim b/tests/test_paints.nim index e44b952..8761dbf 100644 --- a/tests/test_paints.nim +++ b/tests/test_paints.nim @@ -14,45 +14,45 @@ block: heartShape, rgba(255, 0, 0, 255) ) - image.writeFile("tests/images/paths/paintSolid.png") + image.writeFile("tests/paths/paintSolid.png") block: let paint = newPaint(pkImage) - paint.image = decodePng(readFile("tests/images/png/baboon.png")) + paint.image = decodePng(readFile("tests/fileformats/png/baboon.png")) paint.imageMat = scale(vec2(0.2, 0.2)) let image = newImage(100, 100) image.fillPath(heartShape, paint) - image.writeFile("tests/images/paths/paintImage.png") + image.writeFile("tests/paths/paintImage.png") block: let paint = newPaint(pkImage) - paint.image = decodePng(readFile("tests/images/png/baboon.png")) + paint.image = decodePng(readFile("tests/fileformats/png/baboon.png")) paint.imageMat = scale(vec2(0.2, 0.2)) paint.opacity = 0.5 let image = newImage(100, 100) image.fillPath(heartShape, paint) - image.writeFile("tests/images/paths/paintImageOpacity.png") + image.writeFile("tests/paths/paintImageOpacity.png") block: let paint = newPaint(pkImageTiled) - paint.image = decodePng(readFile("tests/images/png/baboon.png")) + paint.image = decodePng(readFile("tests/fileformats/png/baboon.png")) paint.imageMat = scale(vec2(0.02, 0.02)) let image = newImage(100, 100) image.fillPath(heartShape, paint) - image.writeFile("tests/images/paths/paintImageTiled.png") + image.writeFile("tests/paths/paintImageTiled.png") block: let paint = newPaint(pkImageTiled) - paint.image = decodePng(readFile("tests/images/png/baboon.png")) + paint.image = decodePng(readFile("tests/fileformats/png/baboon.png")) paint.imageMat = scale(vec2(0.02, 0.02)) paint.opacity = 0.5 let image = newImage(100, 100) image.fillPath(heartShape, paint) - image.writeFile("tests/images/paths/paintImageTiledOpacity.png") + image.writeFile("tests/paths/paintImageTiledOpacity.png") block: let paint = newPaint(pkGradientLinear) @@ -67,7 +67,7 @@ block: let image = newImage(100, 100) image.fillPath(heartShape, paint) - image.writeFile("tests/images/paths/gradientLinear.png") + image.writeFile("tests/paths/gradientLinear.png") block: let paint = newPaint(pkGradientRadial) @@ -83,7 +83,7 @@ block: let image = newImage(100, 100) image.fillPath(heartShape, paint) - image.writeFile("tests/images/paths/gradientRadial.png") + image.writeFile("tests/paths/gradientRadial.png") block: let paint = newPaint(pkGradientAngular) @@ -99,7 +99,7 @@ block: let image = newImage(100, 100) image.fillPath(heartShape, paint) - image.writeFile("tests/images/paths/gradientAngular.png") + image.writeFile("tests/paths/gradientAngular.png") block: let paint = newPaint(pkGradientAngular) @@ -116,4 +116,4 @@ block: let image = newImage(100, 100) image.fillPath(heartShape, paint) - image.writeFile("tests/images/paths/gradientAngularOpacity.png") + image.writeFile("tests/paths/gradientAngularOpacity.png") diff --git a/tests/test_paths.nim b/tests/test_paths.nim index 36269d6..bc72467 100644 --- a/tests/test_paths.nim +++ b/tests/test_paths.nim @@ -54,7 +54,7 @@ block: pathStr = "M 10 10 L 90 90" color = rgba(255, 0, 0, 255) image.strokePath(pathStr, color, strokeWidth = 10) - image.writeFile("tests/images/paths/pathStroke1.png") + image.writeFile("tests/paths/pathStroke1.png") block: let @@ -62,7 +62,7 @@ block: pathStr = "M 10 10 L 50 60 90 90" color = rgba(255, 0, 0, 255) image.strokePath(pathStr, color, strokeWidth = 10) - image.writeFile("tests/images/paths/pathStroke2.png") + image.writeFile("tests/paths/pathStroke2.png") block: let image = newImage(100, 100) @@ -71,7 +71,7 @@ block: rgba(255, 255, 0, 255), strokeWidth = 10 ) - image.writeFile("tests/images/paths/pathStroke3.png") + image.writeFile("tests/paths/pathStroke3.png") block: let @@ -79,7 +79,7 @@ block: pathStr = "M 10 10 H 90 V 90 H 10 L 10 10" color = rgba(0, 0, 0, 255) image.fillPath(pathStr, color) - image.writeFile("tests/images/paths/pathBlackRectangle.png") + image.writeFile("tests/paths/pathBlackRectangle.png") block: let @@ -87,7 +87,7 @@ block: pathStr = "M 10 10 H 90 V 90 H 10 Z" color = rgba(0, 0, 0, 255) image.fillPath(parsePath(pathStr), color) - image.writeFile("tests/images/paths/pathBlackRectangleZ.png") + image.writeFile("tests/paths/pathBlackRectangleZ.png") block: let image = newImage(100, 100) @@ -95,7 +95,7 @@ block: "M 10 10 H 90 V 90 H 10 L 10 10", rgba(255, 255, 0, 255) ) - image.writeFile("tests/images/paths/pathYellowRectangle.png") + image.writeFile("tests/paths/pathYellowRectangle.png") block: let path = newPath() @@ -107,7 +107,7 @@ block: let image = newImage(100, 100) image.fillPath(path, rgba(255, 0, 0, 255)) - image.writeFile("tests/images/paths/pathRedRectangle.png") + image.writeFile("tests/paths/pathRedRectangle.png") block: let image = newImage(100, 100) @@ -115,7 +115,7 @@ block: "M30 60 A 20 20 0 0 0 90 60 L 30 60", parseHtmlColor("#FC427B").rgba ) - image.writeFile("tests/images/paths/pathBottomArc.png") + image.writeFile("tests/paths/pathBottomArc.png") block: let image = newImage(100, 100) @@ -129,7 +129,7 @@ block: """, parseHtmlColor("#FC427B").rgba ) - image.writeFile("tests/images/paths/pathHeart.png") + image.writeFile("tests/paths/pathHeart.png") block: let image = newImage(100, 100) @@ -137,7 +137,7 @@ block: "M 20 50 A 20 10 45 1 1 80 50 L 20 50", parseHtmlColor("#FC427B").rgba ) - image.writeFile("tests/images/paths/pathRotatedArc.png") + image.writeFile("tests/paths/pathRotatedArc.png") block: let image = newImage(100, 100) @@ -145,7 +145,7 @@ block: "M 0 50 A 50 50 0 0 0 50 0 L 50 50 L 0 50", parseHtmlColor("#FC427B").rgba ) - image.writeFile("tests/images/paths/pathInvertedCornerArc.png") + image.writeFile("tests/paths/pathInvertedCornerArc.png") block: let image = newImage(100, 100) @@ -153,7 +153,7 @@ block: "M 0 50 A 50 50 0 0 1 50 0 L 50 50 L 0 50", parseHtmlColor("#FC427B").rgba ) - image.writeFile("tests/images/paths/pathCornerArc.png") + image.writeFile("tests/paths/pathCornerArc.png") # block: # let @@ -170,14 +170,14 @@ block: # path.arcTo(x, y + h, x, y, r) # path.arcTo(x, y, x + w, y, r) # image.fillPath(path, rgba(255, 0, 0, 255)) -# image.writeFile("tests/images/paths/pathRoundRect.png") +# image.writeFile("tests/paths/pathRoundRect.png") block: let mask = newMask(100, 100) pathStr = "M 10 10 H 90 V 90 H 10 L 10 10" mask.fillPath(pathStr) - writeFile("tests/images/paths/pathRectangleMask.png", mask.encodePng()) + writeFile("tests/paths/pathRectangleMask.png", mask.encodePng()) # block: # let @@ -194,7 +194,7 @@ block: # path.arcTo(x, y + h, x, y, r) # path.arcTo(x, y, x + w, y, r) # mask.fillPath(path) -# writeFile("tests/images/paths/pathRoundRectMask.png", mask.encodePng()) +# writeFile("tests/paths/pathRoundRectMask.png", mask.encodePng()) block: let image = newImage(200, 200) @@ -206,7 +206,7 @@ block: image.strokePath(p, rgba(0, 255, 0, 255), scale(vec2(200, 200)), strokeWidth = 0.01) - image.writeFile("tests/images/paths/pixelScale.png") + image.writeFile("tests/paths/pixelScale.png") block: let @@ -217,7 +217,7 @@ block: path, rgba(0, 0, 0, 255), translate(vec2(10, 10)), 10, lcRound, ljRound ) - image.writeFile("tests/images/paths/boxRound.png") + image.writeFile("tests/paths/boxRound.png") block: let @@ -228,7 +228,7 @@ block: path, rgba(0, 0, 0, 255), translate(vec2(10, 10)), 10, lcRound, ljBevel ) - image.writeFile("tests/images/paths/boxBevel.png") + image.writeFile("tests/paths/boxBevel.png") block: let @@ -239,7 +239,7 @@ block: path, rgba(0, 0, 0, 255), translate(vec2(10, 10)), 10, lcRound, ljMiter ) - image.writeFile("tests/images/paths/boxMiter.png") + image.writeFile("tests/paths/boxMiter.png") block: let @@ -250,7 +250,7 @@ block: path, rgba(0, 0, 0, 255), translate(vec2(10, 10)), 10, lcButt, ljBevel ) - image.writeFile("tests/images/paths/lcButt.png") + image.writeFile("tests/paths/lcButt.png") block: let @@ -261,7 +261,7 @@ block: path, rgba(0, 0, 0, 255), translate(vec2(10, 10)), 10, lcRound, ljBevel ) - image.writeFile("tests/images/paths/lcRound.png") + image.writeFile("tests/paths/lcRound.png") block: let @@ -272,7 +272,7 @@ block: path, rgba(0, 0, 0, 255), translate(vec2(10, 10)), 10, lcSquare, ljBevel ) - image.writeFile("tests/images/paths/lcSquare.png") + image.writeFile("tests/paths/lcSquare.png") block: let @@ -309,7 +309,7 @@ block: dashes = @[1.float32, 2, 3, 4, 5, 6, 7, 8, 9] ) - image.writeFile("tests/images/paths/dashes.png") + image.writeFile("tests/paths/dashes.png") block: proc miterTest(angle, limit: float32) = @@ -326,7 +326,7 @@ block: path, rgba(0, 0, 0, 255), translate(vec2(30, 30)), 8, lcButt, ljMiter, miterLimit = limit ) - image.writeFile(&"tests/images/paths/miterLimit_{angle.int}deg_{limit:0.2f}num.png") + image.writeFile(&"tests/paths/miterLimit_{angle.int}deg_{limit:0.2f}num.png") miterTest(10, 2) miterTest(145, 2) @@ -343,7 +343,7 @@ block: path = parsePath("M0 0 L0 0 L60 0 L60 60 L0 60") image.fill(rgba(255, 255, 255, 255)) image.fillPath(path, rgba(127, 127, 127, 255)) - image.writeFile("tests/images/paths/selfclosing.png") + image.writeFile("tests/paths/selfclosing.png") # Potential error cases, ensure they do not crash @@ -398,7 +398,7 @@ block: "M 30 30 H 80 V 80 H 30 z", paint ) - image.writeFile("tests/images/paths/rectExcludeMask.png") + image.writeFile("tests/paths/rectExcludeMask.png") block: let image = newImage(100, 100) @@ -415,7 +415,7 @@ block: "M 30.1 30.1 H 80.1 V 80.1 H 30.1 z", paint ) - image.writeFile("tests/images/paths/rectExcludeMaskAA.png") + image.writeFile("tests/paths/rectExcludeMaskAA.png") block: let image = newImage(100, 100) @@ -432,7 +432,7 @@ block: "M 30 30 H 80 V 80 H 30 z", paint ) - image.writeFile("tests/images/paths/rectMask.png") + image.writeFile("tests/paths/rectMask.png") block: let image = newImage(100, 100) @@ -449,31 +449,31 @@ block: "M 30.1 30.1 H 80.1 V 80.1 H 30.1 z", paint ) - image.writeFile("tests/images/paths/rectMaskAA.png") + image.writeFile("tests/paths/rectMaskAA.png") block: let mask = newMask(100, 100) mask.fillPath("M 10 10 H 60 V 60 H 10 z") mask.fillPath("M 30 30 H 80 V 80 H 30 z", blendMode = bmExcludeMask) - writeFile("tests/images/paths/maskRectExcludeMask.png", mask.encodePng()) + writeFile("tests/paths/maskRectExcludeMask.png", mask.encodePng()) block: let mask = newMask(100, 100) mask.fillPath("M 10.1 10.1 H 60.1 V 60.1 H 10.1 z") mask.fillPath("M 30.1 30.1 H 80.1 V 80.1 H 30.1 z", blendMode = bmExcludeMask) - writeFile("tests/images/paths/maskRectExcludeMaskAA.png", mask.encodePng()) + writeFile("tests/paths/maskRectExcludeMaskAA.png", mask.encodePng()) block: let mask = newMask(100, 100) mask.fillPath("M 10 10 H 60 V 60 H 10 z") mask.fillPath("M 30 30 H 80 V 80 H 30 z", blendMode = bmMask) - writeFile("tests/images/paths/maskRectMask.png", mask.encodePng()) + writeFile("tests/paths/maskRectMask.png", mask.encodePng()) block: let mask = newMask(100, 100) mask.fillPath("M 10.1 10.1 H 60.1 V 60.1 H 10.1 z") mask.fillPath("M 30.1 30.1 H 80.1 V 80.1 H 30.1 z", blendMode = bmMask) - writeFile("tests/images/paths/maskRectMaskAA.png", mask.encodePng()) + writeFile("tests/paths/maskRectMaskAA.png", mask.encodePng()) block: var @@ -500,7 +500,7 @@ block: else: ctx.stroke() - surface.writeFile("tests/images/paths/arc.png") + surface.writeFile("tests/paths/arc.png") block: var @@ -519,7 +519,7 @@ block: ctx.lineTo(p2.x, p2.y) ctx.stroke() - surface.writeFile("tests/images/paths/arcTo1.png") + surface.writeFile("tests/paths/arcTo1.png") block: var @@ -555,7 +555,7 @@ block: ctx.arc(50, 20, 5, 0, 2 * PI) # Control point two ctx.fill() - surface.writeFile("tests/images/paths/arcTo2.png") + surface.writeFile("tests/paths/arcTo2.png") block: var @@ -569,7 +569,7 @@ block: ctx.lineTo(110, 130) ctx.stroke() - surface.writeFile("tests/images/paths/arcTo3.png") + surface.writeFile("tests/paths/arcTo3.png") block: let path = newPath() @@ -620,7 +620,7 @@ block: let image = newImage(100, 100) image.fillPath(path, paint) - image.writeFile("tests/images/paths/opacityFill.png") + image.writeFile("tests/paths/opacityFill.png") block: let path = newPath() @@ -633,4 +633,4 @@ block: let image = newImage(100, 100) image.strokePath(path, paint, strokeWidth = 10) - image.writeFile("tests/images/paths/opacityStroke.png") + image.writeFile("tests/paths/opacityStroke.png") diff --git a/tests/test_png.nim b/tests/test_png.nim index 57a618e..0b61060 100644 --- a/tests/test_png.nim +++ b/tests/test_png.nim @@ -26,10 +26,10 @@ block: for file in pngSuiteCorruptedFiles: try: - discard decodePng(readFile(&"tests/images/png/pngsuite/{file}.png")) + discard decodePng(readFile(&"tests/fileformats/png/pngsuite/{file}.png")) doAssert false except PixieError: discard block: - discard readImage("tests/images/png/trailing_data.png") + discard readImage("tests/fileformats/png/trailing_data.png") diff --git a/tests/test_svg.nim b/tests/test_svg.nim index d82449a..5d09d79 100644 --- a/tests/test_svg.nim +++ b/tests/test_svg.nim @@ -17,12 +17,12 @@ const files = [ ] proc doDiff(rendered: Image, name: string) = - rendered.writeFile(&"tests/images/svg/rendered/{name}.png") + rendered.writeFile(&"tests/fileformats/svg/rendered/{name}.png") let - master = readImage(&"tests/images/svg/masters/{name}.png") + master = readImage(&"tests/fileformats/svg/masters/{name}.png") (diffScore, diffImage) = diff(master, rendered) echo &"{name} score: {diffScore}" - diffImage.writeFile(&"tests/images/svg/diffs/{name}.png") + diffImage.writeFile(&"tests/fileformats/svg/diffs/{name}.png") for file in files: - doDiff(decodeSvg(readFile(&"tests/images/svg/{file}.svg")), file) + doDiff(decodeSvg(readFile(&"tests/fileformats/svg/{file}.svg")), file) diff --git a/tests/validate_jpg.nim b/tests/validate_jpg.nim index 93de6ad..2137c03 100644 --- a/tests/validate_jpg.nim +++ b/tests/validate_jpg.nim @@ -1,3 +1,3 @@ import pixie/fileformats/jpg, pixie/fileformats/stb_image/stb_image -let original = readFile("tests/images/jpg/jpeg420exif.jpg") +let original = readFile("tests/fileformats/jpg/jpeg420exif.jpg") diff --git a/tests/validate_png.nim b/tests/validate_png.nim index d5be59f..b39b5f6 100644 --- a/tests/validate_png.nim +++ b/tests/validate_png.nim @@ -2,8 +2,8 @@ import chroma, pixie/fileformats/png, pngsuite, stb_image/read as stbi, strforma for file in pngSuiteFiles: let - data = readFile(&"tests/images/png/pngsuite/{file}.png") - pixieLoaded = decodePng(cast[seq[uint8]](data)) + data = readFile(&"tests/fileformats/png/pngsuite/{file}.png") + pixieLoaded = decodePngRaw(data) var width, height, channels: int