Skip to content

README: note that Pillow built with Raqm already shapes (reshaping corrupts it) - #103

Open
Syamjith-NK wants to merge 1 commit into
mpcabd:masterfrom
Syamjith-NK:readme-raqm-note
Open

README: note that Pillow built with Raqm already shapes (reshaping corrupts it)#103
Syamjith-NK wants to merge 1 commit into
mpcabd:masterfrom
Syamjith-NK:readme-raqm-note

Conversation

@Syamjith-NK

@Syamjith-NK Syamjith-NK commented Aug 19, 2026

Copy link
Copy Markdown

Follows #102.

The README currently tells every reader that "PIL Image does not support reshaping out of the box,
so ... you would need to reshape the text for sure." That was true when it was written, and is now
false whenever Pillow is built with Raqm — In that
configuration the example produces corrupted Arabic rather than correct Arabic.

This adds the features.check("raqm") test and states which branch the existing example belongs
to. It does not change the example itself, which remains correct for Pillow without Raqm.

Measured before writing this (5 strings × 3 fonts per path):

path no preprocessing with reshape() + get_display()
Pillow with Raqm 15/15 identical 0/15 — 14 broken, 1 recognisable
Pillow without Raqm 0/15 — 15 broken 0/15 — 9 recognisable, 6 still broken

Note the second row: where the recipe IS needed it is a partial rescue rather than a fix. I have
deliberately kept that out of the README, since it is a separate discussion from "does this
example apply to me" — but it is why the wording says the example is "needed" rather than
"sufficient".

Data and reproduction: https://huggingface.co/datasets/syamjithnk/arshape (CC BY 4.0)


Correction (21 Aug 2026). An earlier version of this description implied that recent Pillow wheels are Raqm-enabled by default. That is not right, and I have corrected it on #102 as well. Whether Pillow shapes Arabic depends on the machine, not the version. The wheels bundle a statically linked libraqm, but libraqm links FriBiDi at runtime and FriBiDi is not in the wheel — so the same wheel answers True on a host that has it and False on one that does not. A slim container or a minimal CI image usually does not. So this library is needed more often than that wording implied, and the point of this PR is only that a reader cannot currently tell which case they are in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant