Skip to content

Commit

Permalink
fixed coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Piskun <[email protected]>
  • Loading branch information
bigcat88 committed Nov 12, 2023
1 parent d954e7f commit 9f7fa07
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/write_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,20 @@ def test_YCbCr_color_mode(
helpers.assert_image_similar(Image.open(buf_jpeg), im_heif, expected_max_difference)


def test_heif_YCbCr_color_mode(): # noqa
# we support YCbCr for PIL only.
# in this test case, the image will be converted to "RGB" during "from_pillow".
im = helpers.gradient_rgb().convert("YCbCr")
assert im.mode == "YCbCr"
im_heif = pillow_heif.from_pillow(im)
assert im_heif.mode == "RGB"
out_heif = BytesIO()
im_heif.save(out_heif, format="HEIF", quality=-1)
im_out = Image.open(out_heif)
assert im_out.mode == "RGB"
helpers.compare_hashes([im, im_out], hash_size=32)


@pytest.mark.parametrize("enc_bits", (10, 12))
@pytest.mark.parametrize("save_format", ("HEIF", "AVIF"))
def test_I_color_modes_to_10_12_bit(enc_bits, save_format): # noqa
Expand Down

0 comments on commit 9f7fa07

Please sign in to comment.