rename: src/Formats -> src/Rosetta, @formats -> @rosetta requires, build/luajit/rosetta + rosetta._compat, build/roblox/Rosetta, ROSETTA_* env/globals, writer vendor strings
This commit is contained in:
1 parent
2956576d7f
commit
22ddcd78fa
941 files changed
+3364
-3364
No files matched your search
@@ -4,11 +4,11 @@
|
||||
-- encoder byte-identical to cjpeg for the same settings, its PSNR, round trips through our decoder; truncated files;
|
||||
-- the fuzz no-throw pass. Ported from jpeg-luau tests/jpeg.luau. Fixtures: tools/fixtures/jpeg.py.
|
||||
local T = require("@tests/T")
|
||||
local Jpeg = require("@formats/image/jpeg")
|
||||
local Bytes = require("@formats/core/Bytes")
|
||||
local Crc32 = require("@formats/core/Crc32")
|
||||
local Err = require("@formats/core/Err")
|
||||
local Types = require("@formats/Types")
|
||||
local Jpeg = require("@rosetta/image/jpeg")
|
||||
local Bytes = require("@rosetta/core/Bytes")
|
||||
local Crc32 = require("@rosetta/core/Crc32")
|
||||
local Err = require("@rosetta/core/Err")
|
||||
local Types = require("@rosetta/Types")
|
||||
local Dec = require("@tests/gen/jpeg_dec")
|
||||
local Enc = require("@tests/gen/jpeg_enc")
|
||||
|
||||
@@ -240,13 +240,13 @@ do
|
||||
t:check(buffer.tostring(a) == buffer.tostring(b), "rgba8 input encodes as rgb8 (alpha ignored)")
|
||||
img.meta.icc = buffer.fromstring(string.rep("P", 70000))
|
||||
img.meta.exif = buffer.fromstring("MM\0\42\0\0\0\8\0\1\1\18\0\3\0\0\0\1\0\6\0\0\0\0\0\0")
|
||||
img.meta.text = { comment = "made by formats-luau" }
|
||||
img.meta.text = { comment = "made by rosetta" }
|
||||
img.meta.dpi = { x = 300, y = 300 }
|
||||
local m = Jpeg.encode(img, { quality = 80 }) :: buffer
|
||||
local back = decode(m)
|
||||
t:check(back.meta.icc and buffer.len(back.meta.icc) == 70000, "ICC round trip (two APP2 chunks)")
|
||||
t:eq(back.meta.orientation, 6, "EXIF round trip")
|
||||
t:check(back.meta.text and back.meta.text.comment == "made by formats-luau", "COM round trip")
|
||||
t:check(back.meta.text and back.meta.text.comment == "made by rosetta", "COM round trip")
|
||||
t:check(back.meta.dpi and back.meta.dpi.x == 300, "density round trip")
|
||||
local nm = Jpeg.encode(img, { quality = 80, meta = false, jfif = false }) :: buffer
|
||||
t:check(buffer.len(nm) < buffer.len(a), "meta = false, jfif = false")
|
||||
|
||||
Reference in new issue
Block a user