mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
Correction of the unbufferizing
This commit is contained in:
parent
b170c5627e
commit
af72132349
|
@ -140,9 +140,7 @@ class FreeTypeFont:
|
|||
self.font = core.getfont(font, size, index, encoding)
|
||||
else:
|
||||
bytes = font.read()
|
||||
font.seek(0, 2)
|
||||
size = font.tell()
|
||||
self.font = core.getfont("", size, index, encoding, bytes, size)
|
||||
self.font = core.getfont("", size, index, encoding, bytes)
|
||||
|
||||
def getname(self):
|
||||
return self.font.family, self.font.style
|
||||
|
|
|
@ -106,10 +106,10 @@ getfont(PyObject* self_, PyObject* args, PyObject* kw)
|
|||
unsigned char* file_like;
|
||||
int file_like_size = 0;
|
||||
static char* kwlist[] = {
|
||||
"filename", "size", "index", "encoding", "file_like", "file_like_size", NULL
|
||||
"filename", "size", "index", "encoding", "file_like", NULL
|
||||
};
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kw, "eti|isz*i", kwlist,
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kw, "eti|iss#", kwlist,
|
||||
Py_FileSystemDefaultEncoding, &filename,
|
||||
&size, &index, &encoding, &file_like,
|
||||
&file_like_size))
|
||||
|
@ -148,8 +148,6 @@ getfont(PyObject* self_, PyObject* args, PyObject* kw)
|
|||
return geterror(error);
|
||||
}
|
||||
|
||||
fprintf(stderr, "> %d %d %s\n", error, file_like_size, self);
|
||||
|
||||
return (PyObject*) self;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user