* Add new jpeg tests. * Resurrect old jpeg. * Fix Jpeg grayscale * Fix 4:1:1 scaling. * Better chunk scanner. * Fight progressive. * Fight restart markers. * Jpeg can now parse all of the test files. * Fuzzing and overflow checks * Make getBits* the only way to read the bits. * Make Quantiziation and IDCT happen only in one place. * Rename jpg folder to jpeg
46 lines
1.7 KiB
Nim
46 lines
1.7 KiB
Nim
import pixie, strutils
|
|
|
|
import pixie/fileformats/jpg
|
|
|
|
var files = @[
|
|
"tests/fileformats/jpeg/master/red.jpg",
|
|
"tests/fileformats/jpeg/master/green.jpg",
|
|
"tests/fileformats/jpeg/master/blue.jpg",
|
|
"tests/fileformats/jpeg/master/white.jpg",
|
|
"tests/fileformats/jpeg/master/black.jpg",
|
|
|
|
"tests/fileformats/jpeg/master/8x8.jpg",
|
|
"tests/fileformats/jpeg/master/8x8_progressive.jpg",
|
|
|
|
"tests/fileformats/jpeg/master/16x16.jpg",
|
|
"tests/fileformats/jpeg/master/16x16_progressive.jpg",
|
|
|
|
"tests/fileformats/jpeg/master/quality_01.jpg",
|
|
"tests/fileformats/jpeg/master/quality_10.jpg",
|
|
"tests/fileformats/jpeg/master/quality_25.jpg",
|
|
"tests/fileformats/jpeg/master/quality_50.jpg",
|
|
"tests/fileformats/jpeg/master/quality_100.jpg",
|
|
|
|
"tests/fileformats/jpeg/master/cat_4_4_4.jpg",
|
|
"tests/fileformats/jpeg/master/cat_4_4_4.jpg",
|
|
"tests/fileformats/jpeg/master/cat_4_2_2.jpg",
|
|
"tests/fileformats/jpeg/master/cat_4_2_0.jpg",
|
|
"tests/fileformats/jpeg/master/cat_4_1_1.jpg",
|
|
"tests/fileformats/jpeg/master/cat_4_4_4_progressive.jpg",
|
|
"tests/fileformats/jpeg/master/cat_restart_markers_5.jpg",
|
|
"tests/fileformats/jpeg/master/cat_restart_markers_5_progressive.jpg",
|
|
|
|
"tests/fileformats/jpeg/master/mandrill.jpg",
|
|
"tests/fileformats/jpeg/master/exif_overrun.jpg",
|
|
"tests/fileformats/jpeg/master/grayscale_test.jpg",
|
|
"tests/fileformats/jpeg/master/progressive.jpg",
|
|
|
|
"tests/fileformats/jpeg/master/testimg.jpg",
|
|
"tests/fileformats/jpeg/master/testimgp.jpg",
|
|
"tests/fileformats/jpeg/master/testorig.jpg",
|
|
"tests/fileformats/jpeg/master/testprog.jpg",
|
|
]
|
|
|
|
for file in files:
|
|
var img = decodeJpg(readFile(file))
|
|
# img.writeFile(file.replace("master", "generated").replace(".jpg", ".jpeg.png"))
|