File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -824,7 +824,6 @@ font_render(FontObject *self, PyObject *args) {
824824 unsigned char convert_scale ; /* scale factor for non-8bpp bitmaps */
825825 PyObject * image ;
826826 Imaging im ;
827- Py_ssize_t id ;
828827 int mask = 0 ; /* is FT_LOAD_TARGET_MONO enabled? */
829828 int color = 0 ; /* is FT_LOAD_COLOR enabled? */
830829 int stroke_width = 0 ;
@@ -923,10 +922,9 @@ font_render(FontObject *self, PyObject *args) {
923922 PyMem_Del (glyph_info );
924923 return NULL ;
925924 }
926- PyObject * imageId = PyObject_GetAttrString (image , "id" );
927- id = PyLong_AsSsize_t (imageId );
928- Py_XDECREF (imageId );
929- im = (Imaging )id ;
925+ PyObject * imagePtr = PyObject_GetAttrString (image , "ptr" );
926+ im = (Imaging )PyCapsule_GetPointer (imagePtr , IMAGING_MAGIC );
927+ Py_XDECREF (imagePtr );
930928
931929 x_offset -= stroke_width ;
932930 y_offset -= stroke_width ;
You can’t perform that action at this time.
0 commit comments