Skip to content

Commit ba9c830

Browse files
committed
Corrected writing I;16 text
1 parent 5e2332a commit ba9c830

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Tests/test_imagefont.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ def test_I16(font):
141141
draw = ImageDraw.Draw(im)
142142

143143
txt = "Hello World!"
144-
draw.text((10, 10), txt, font=font)
144+
draw.text((10, 10), txt, fill=0xFFFE, font=font)
145+
146+
assert im.getpixel((12, 14)) == 0xFFFE
145147

146148
target = "Tests/images/transparent_background_text_L.png"
147149
assert_image_similar_tofile(im.convert("L"), target, 0.01)

src/libImaging/Paste.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ fill_mask_L(
425425
*out = BLEND(*mask, *out, ink[0], tmp1);
426426
if (strncmp(imOut->mode, "I;16", 4) == 0) {
427427
out++;
428-
*out = BLEND(*mask, *out, ink[0], tmp1);
428+
*out = BLEND(*mask, *out, ink[1], tmp1);
429429
}
430430
out++, mask++;
431431
}

0 commit comments

Comments
 (0)