mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 01:46:18 +03:00
add read from URL example
This commit is contained in:
parent
5d070222d2
commit
12665d8db4
|
@ -504,6 +504,17 @@ image header. In addition, seek will also be used when the image data is read
|
|||
tar file, you can use the :py:class:`~PIL.ContainerIO` or
|
||||
:py:class:`~PIL.TarIO` modules to access it.
|
||||
|
||||
Reading from URL
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
::
|
||||
|
||||
from PIL import Image
|
||||
from urllib.request import urlopen
|
||||
url = "https://raw.githubusercontent.com/python-pillow/pillow-logo/main/pillow-logo-248x250.png"
|
||||
img = Image.open(urlopen(url))
|
||||
|
||||
|
||||
Reading from a tar archive
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user