mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-18 03:04:45 +03:00
Use "file path" or "path" instead of "filepath" which isn't used much
By @hugovk. Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
This commit is contained in:
parent
39f3913b9d
commit
d788682afe
|
@ -2155,8 +2155,8 @@ class Image:
|
|||
|
||||
def save(self, fp, format=None, **params):
|
||||
"""
|
||||
Saves this image under the given filepath. If no format is
|
||||
specified, the format to use is determined from the filepath's
|
||||
Saves this image under the given file path. If no format is
|
||||
specified, the format to use is determined from the path's
|
||||
file extension, if possible.
|
||||
|
||||
Keyword options can be used to provide additional instructions
|
||||
|
@ -2165,12 +2165,12 @@ class Image:
|
|||
:doc:`image format documentation
|
||||
<../handbook/image-file-formats>` for each writer.
|
||||
|
||||
You can use a file object instead of a filepath. In this case,
|
||||
You can use a file object instead of a file path. In this case,
|
||||
you must always specify the format. The file object must
|
||||
implement the ``seek``, ``tell``, and ``write``
|
||||
methods, and be opened in binary mode.
|
||||
|
||||
:param fp: A filepath (str or bytes), path-like object or file object.
|
||||
:param fp: A file path (str or bytes), path-like object or file object.
|
||||
:param format: Optional format override. If omitted, the
|
||||
format to use is determined from the filename extension.
|
||||
If a file object was used instead of a filename, this
|
||||
|
@ -2930,7 +2930,7 @@ def open(fp, mode="r", formats=None):
|
|||
:py:meth:`~PIL.Image.Image.load` method). See
|
||||
:py:func:`~PIL.Image.new`. See :ref:`file-handling`.
|
||||
|
||||
:param fp: A filepath (str or bytes), path-like object or a file object.
|
||||
:param fp: A file path (str or bytes), path-like object or a file object.
|
||||
The file object must implement ``file.read``,
|
||||
``file.seek``, and ``file.tell`` methods,
|
||||
and be opened in binary mode.
|
||||
|
|
|
@ -798,9 +798,9 @@ def load(filename):
|
|||
|
||||
def truetype(font=None, size=10, index=0, encoding="", layout_engine=None):
|
||||
r"""
|
||||
Load a TrueType or OpenType font from a filepath or file-like object,
|
||||
Load a TrueType or OpenType font from a file path or file-like object,
|
||||
and create a font object.
|
||||
This function loads a font object from the given filepath or file-like
|
||||
This function loads a font object from the given file path or file-like
|
||||
object, and creates a font object for a font of the given size.
|
||||
|
||||
Pillow uses FreeType to open font files. If you are opening many fonts
|
||||
|
@ -810,8 +810,8 @@ def truetype(font=None, size=10, index=0, encoding="", layout_engine=None):
|
|||
|
||||
This function requires the _imagingft service.
|
||||
|
||||
:param font: A filepath or file-like object containing a TrueType font.
|
||||
If the file is not found at this filepath, the loader may also
|
||||
:param font: A file path or file-like object containing a TrueType font.
|
||||
If the file is not found at this path, the loader may also
|
||||
search in other directories, such as the :file:`%WINDIR%\fonts\`
|
||||
directory on Windows or :file:`/Library/Fonts/`,
|
||||
:file:`/System/Library/Fonts/` and :file:`~/Library/Fonts/`
|
||||
|
|
Loading…
Reference in New Issue
Block a user