Commit f80675c5 authored by narugo1992's avatar narugo1992
Browse files

Merge branch 'main' into dev/attachments

parents 22519b20 1ebc45c7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -15,3 +15,4 @@ imgutils.data
    decode
    image
    layer
    url
+22 −0
Original line number Diff line number Diff line
imgutils.data.url
==========================

.. currentmodule:: imgutils.data.url

.. automodule:: imgutils.data.url


download_image_from_url
-----------------------------------------------------

.. autofunction:: download_image_from_url



is_http_url
-----------------------------------------------------

.. autofunction:: is_http_url


+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ Overview:
__TITLE__ = 'imgutils'

#: Version of this project.
__VERSION__ = '0.12.0'
__VERSION__ = '0.14.1'

#: Short description of the project, will be included in ``setup.py``.
__DESCRIPTION__ = 'A convenient and user-friendly anime-style image data processing library that integrates ' \
+1 −0
Original line number Diff line number Diff line
@@ -8,3 +8,4 @@ from .decode import *
from .encode import *
from .image import *
from .layer import *
from .url import *
 No newline at end of file
+4 −0
Original line number Diff line number Diff line
@@ -107,8 +107,12 @@ def load_image(image: ImageTyping, mode=None, force_background: Optional[str] =
    'RGB'
    """
    from .blob import is_valid_image_blob_url, load_image_from_blob_url
    from .url import is_http_url, download_image_from_url

    if isinstance(image, str) and is_valid_image_blob_url(image):
        image = load_image_from_blob_url(image)
    elif isinstance(image, str) and is_http_url(image):
        image = download_image_from_url(image, silent=True)
    elif isinstance(image, (str, PathLike, bytes, bytearray, BinaryIO)) or _is_readable(image):
        image = Image.open(image)
    elif isinstance(image, Image.Image):
Loading