Commit Graph

130 Commits

Author SHA1 Message Date
Nulano
30015f6236 simplify decompression bomb check in FreeTypeFont.render 2023-12-27 17:05:14 +01:00
Andrew Murray
6768d3aa91
Merge pull request #7497 from ZachNagengast/fix-alpha-for-overlapping-glyphs
Fix incorrect color blending for overlapping glyphs in BGRA mode
2023-12-24 19:03:28 +11:00
Hugo van Kemenade
b638d056d5
Merge pull request #7548 from radarhere/imagefont 2023-12-21 12:55:20 +02:00
Andrew Murray
a6a612c6c5
Merge branch 'main' into fix-alpha-for-overlapping-glyphs 2023-12-02 21:33:29 +11:00
Zach Nagengast
78f78d2aa7
Update src/_imagingft.c
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
2023-11-28 11:53:46 -08:00
Zach Nagengast
9c60e856ad
Apply suggestions from code review
Co-authored-by: Ondrej Baranovič <nulano@nulano.eu>
2023-11-27 09:20:40 -08:00
Andrew Murray
086ca274fa Decrement reference count for PyObject 2023-11-13 15:11:28 +11:00
Andrew Murray
f016d3079b Determine mask mode in Python instead of C 2023-11-13 14:31:22 +11:00
ZachNagengast
8ecf2e9f30 Merge branch 'fix-alpha-for-overlapping-glyphs' of ssh://github.com/ZachNagengast/Pillow into fix-alpha-for-overlapping-glyphs 2023-11-06 21:11:36 -08:00
ZachNagengast
fdecfca9f4 Update gray glyph blending logic and tests 2023-11-06 21:11:28 -08:00
Zach Nagengast
b15b2d494c
Update src/_imagingft.c
Co-authored-by: Ondrej Baranovič <nulano@nulano.eu>
2023-11-06 20:48:22 -08:00
ZachNagengast
bb0eff44cd Update blending logic
- Unpremultiply properly
- No longer uses floats
2023-11-03 15:05:55 -07:00
ZachNagengast
f97570f523 Blend colors with alpha when pasting
- Previously took the highest alpha as threshold
2023-10-26 21:40:41 -07:00
Hugo van Kemenade
4d66f9396b
Merge pull request #7247 from radarhere/getmask2_max_image_pixels 2023-10-05 09:28:04 -06:00
Yay295
e7398c7888 update PyTypeObject slot names
tp_print was renamed to tp_vectorcall_offset with Python 3.8, and tp_compare was renamed to tp_as_async with Python 3.5.
tp_size has always been tp_basicsize; I don't know why that one was wrong.
2023-07-02 00:52:08 -05:00
Andrew Murray
74859e965d Moved MAX_IMAGE_PIXELS check to Python 2023-07-01 20:52:44 +10:00
Andrew Murray
39a3b1d83e Fixed deallocating mask images 2023-07-01 18:09:27 +10:00
Andrew Murray
8437d98f7f Limit size even if one dimension is zero 2023-06-28 11:43:05 +10:00
Andrew Murray
fd9bea271a
Compare long long with long long
Co-authored-by: Ondrej Baranovič <ondreko.tiba@gmail.com>
2023-06-17 14:39:34 +10:00
Andrew Murray
7044038e70 Fixed decompression bomb check 2023-06-17 14:35:44 +10:00
Andrew Murray
98cc2e63ac Destroy image on error 2023-06-15 14:27:38 +10:00
Andrew Murray
618c00c4ea Return early if image is null 2023-06-15 14:27:33 +10:00
Andrew Murray
538971532d Corrected error code
Co-authored-by: nulano <nulano@nulano.eu>
2023-06-14 08:55:21 +10:00
Hugo van Kemenade
8f3ccff8f2
Merge pull request #7206 from radarhere/text_layout 2023-06-13 20:31:24 +03:00
Andrew Murray
4dcca33d30 Removed unused arguments 2023-06-10 19:06:25 +10:00
Andrew Murray
389ad11693 Only call text_layout once in getmask2 2023-06-10 17:10:42 +10:00
Andrew Murray
c45019fe0c Replaced deprecated Py_FileSystemDefaultEncoding for Python >= 3.12 2023-05-29 12:28:03 +10:00
Andrew Murray
81a756e93b Support float font sizes 2023-04-22 13:45:18 +10:00
Hugo van Kemenade
3cfdef395e
Merge pull request #7047 from nulano/freetype-import
Do not discard error message if _imagingft fails to import
2023-04-01 08:43:45 +03:00
nulano
e971674011
cleanup in _imagingft 2023-03-31 02:08:58 +02:00
Andrew Murray
448ab0a687
Call FT_Done_MM_Var when returning early
Co-authored-by: Ondrej Baranovič <3819630+nulano@users.noreply.github.com>
2023-03-30 14:36:58 +11:00
Andrew Murray
7632d8df36 Do not DECREF individual list items, reverting grouping 2023-03-30 12:35:07 +11:00
Andrew Murray
dc79a09d62 Merge branch 'main' into null 2023-03-22 18:56:52 +11:00
nulano
1a11ba662c
do not insert null into dict 2023-03-21 22:05:26 +00:00
nulano
76d36da12e
avoid Py_DECREF(Py_None) 2023-03-21 00:59:00 +00:00
Andrew Murray
dfeed0eb7e Group decrementing reference counts for previous axes in font_getvaraxes 2023-03-20 22:44:14 +11:00
Andrew Murray
6328662248 PyUnicode_* may return NULL 2023-03-20 17:36:55 +11:00
Andrew Murray
b3d7823740 Decrement reference count 2023-03-12 00:11:48 +11:00
Andrew Murray
c63b0ca210 Decrement reference count 2023-03-11 18:32:43 +11:00
Andrew Murray
929dbba834 Handle failure from PyDict_New or PyList_New 2023-03-10 17:37:06 +11:00
Andrew Murray
51d95add6a Replaced IOError with OSError 2023-01-01 07:03:09 +11:00
Eric Soroos
1c57ab8429 Return a PyError instead of a fake fterror.
* Update Tests to IOError rather than OSError
2023-01-01 07:03:09 +11:00
Eric Soroos
87d1770c18 Fix null pointer dereference crash with malformed font 2023-01-01 07:03:09 +11:00
Andrew Murray
5471dc2b26 Use fractional coordinates when drawing text 2022-11-08 11:49:39 +11:00
Andrew Murray
f9a2f991db Replaced IOError with OSError 2022-11-04 11:48:18 +11:00
Hugo van Kemenade
966e98f36a
Merge pull request #6330 from nulano/imagingft-leak
Fix memory leaks related to text features
2022-10-29 10:58:36 +03:00
Christoph Gohlke
6788e8f957
Fix malloc in _imagingft.c:font_setvaraxes 2022-10-26 11:11:30 -07:00
nulano
dacd5d6eb9
add decref calls to imagingft to fix #6321 2022-05-24 16:36:30 +01:00
Hugo van Kemenade
606b5ae1e5 Remove support for FreeType 2.7 and older 2021-10-18 09:29:53 +03:00
nulano
19f4c6fd23 don't use bitmap glyphs when drawing text with stroker 2021-10-14 08:19:04 +01:00