-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Tests/LibGfx: Add a CMYK TIFF roundtrip test, and basic CMYK JPEG coverage #26344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
LucasChollet
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, more tests!
| { | ||
| // JPEG is lossy, so the roundtripped bitmap won't match the original bitmap. But it should still have the same size. | ||
| (void)TRY_OR_FAIL((get_roundtrip_bitmap<Gfx::JPEGWriter, Gfx::JPEGImageDecoderPlugin>(TRY_OR_FAIL(create_test_rgb_bitmap())))); | ||
| (void)TRY_OR_FAIL((get_roundtrip_bitmap<Gfx::JPEGWriter, Gfx::JPEGImageDecoderPlugin>(TRY_OR_FAIL(create_test_cmyk_bitmap())))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We really need to implement some sort of safety net and have these tests check against a maximal accepted error. (Your commit is fine as is, I'm just thinking out loud).
Now that we have a lossless CMYK encoder, we can add a roundtrip test for CMYK encoding :^)
Since JPEG encoding is lossy, this only checks that the image size doesn't change during a roundtrip.
This allows us to remove the CMYKBitmap overload. For CMYKBitmap, we'll always go down the `if constexpr`. Requires manually converting all NonnullRefPtrs to const refs due to the stricter type checking on templates. No behavior change.
This allows us to share one version for Bitmap and CMYKBitmap overload. Requires manually converting all NonnullRefPtrs to const refs due to the stricter type checking on templates. No behavior change.
This allows us to share one version for Bitmap and CMYKBitmap overload. Requires manually converting all NonnullRefPtrs to const refs due to the stricter type checking on templates. No behavior change.
7fbb5d4 to
51c9d73
Compare
Now that we have a lossless CMYK encoder, we can add a roundtrip
test for CMYK encoding :^)
Since JPEG encoding is lossy, the JPEG test only checks that the image size
doesn't change during a roundtrip.