-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Deprecate old FreeType? #5075
Comments
Apart from updating tests, the only change that I can see in the code is diff --git a/src/_imagingft.c b/src/_imagingft.c
index 62db561e..17797c83 100644
--- a/src/_imagingft.c
+++ b/src/_imagingft.c
@@ -1034,12 +1034,7 @@ font_render(FontObject* self, PyObject* args)
case FT_PIXEL_MODE_GRAY4:
if (!bitmap_converted_ready) {
-#if FREETYPE_MAJOR > 2 ||\
- (FREETYPE_MAJOR == 2 && FREETYPE_MINOR > 6)
FT_Bitmap_Init(&bitmap_converted);
-#else
- FT_Bitmap_New(&bitmap_converted);
-#endif
bitmap_converted_ready = 1;
}
error = FT_Bitmap_Convert(library, &bitmap, &bitmap_converted, 1); On the day when we deprecate < 2.9.1, we can drop errors about not supporting variation fonts. So the gain in code simplicity seems minimal to me. That said, if we wanted to deprecate older FreeType to encourage good security behaviour from users, or to better reflect the fact that we're not testing them properly anymore, then sure. I would suggest throwing the |
It is worth noting that I would have missed the block above in #4955 without the tests (now removed in #5060), which would have unintentionally removed support for some version of FreeType before 2.7 (I did not look through the changelog, but 2.6.1 seems to be fine without it). So +1 to deprecate to reflect that it is no longer tested. Raising a warning in the constructor sounds like a good option. |
We're supporting some very old versions of FreeType. Here's some version we check for, and the release date for that version:
The latest FreeType 2.10.4 fixes a severe vulnerability: "All users should update immediately".
We're only testing recent releases.
Shall we deprecate support for some old versions of FreeType?
It's likely the next major release Pillow 9.0.0 will be on 2022-01-02, due to the Python 3.6 EOL (2021-12-23), giving plenty of time for deprecation.
Checking some distros from https://repology.org/project/freetype/versions / https://packages.debian.org/source/buster/freetype:
Removing those distros which will be EOL before 2022-01-02 and sorting by FreeType version:
Suggesting 2.7 and older would be a good cutoff.
Shall we deprecate support for 2.7 and older (or something else)? Is it worth it?
What would the deprecation look like?
The text was updated successfully, but these errors were encountered: