mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-05-05 00:13:42 +03:00
Merge pull request #6215 from kolibril13/readURL
Add example to read image from URL
This commit is contained in:
commit
46ba6b51de
|
@ -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
|
tar file, you can use the :py:class:`~PIL.ContainerIO` or
|
||||||
:py:class:`~PIL.TarIO` modules to access it.
|
:py:class:`~PIL.TarIO` modules to access it.
|
||||||
|
|
||||||
|
Reading from URL
|
||||||
|
^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
from PIL import Image
|
||||||
|
from urllib.request import urlopen
|
||||||
|
url = "https://python-pillow.org/images/pillow-logo.png"
|
||||||
|
img = Image.open(urlopen(url))
|
||||||
|
|
||||||
|
|
||||||
Reading from a tar archive
|
Reading from a tar archive
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user