Skip to main content

cv2ImageLoad

python cv2通过图片文件、图片url、图片的base64编码加载图片。cv2ImageLoad

安装

pip install cv2imageload

使用

from cv2imageload import ImageLoad, ImageLoadError

file = 'th-108.jpg'
url = 'http://*.com/test.png'
base64_str = '图片的base64编码字符串'

# 加载图片文件
try:
    image = ImageLoad.loadImage(file)
except ImageLoadError as e:
    print(e.reason)

# 加载url图片
try:
    image = ImageLoad.loadImage(url)
except ImageLoadError as e:
    print(e.reason)

# 加载base64编码的图片
try:
    image = ImageLoad.loadImage(base64_str)
except ImageLoadError as e:
    print(e.reason)

# 将图片编码为base64字符串
try:
    base64_str = ImageLoad.base64EncodeImage(image, with_base64_header=True, file_ext='jpg')
except ImageLoadError as error:
    print(error.reason)
print(base64_str[:30])

Release files for cv2imageload 1.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cv2imageload 1.0.6
File Size Uploaded
cv2imageload-1.0.6.tar.gz 3.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cv2imageload 1.0.6
File Interpreter ABI Platform
cv2imageload-1.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 8.3 kB

Release files / cv2imageload-1.0.6.tar.gz

Download URL cv2imageload-1.0.6.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c959b22400a1035ec3392aca140e6c71724d58a0b7f3e5cb1de454f48e47a4a7
BLAKE2b-256 checksum
How to use checksums
c8736d3379f52fb5dcf7ecf2e2355984e8208043e106bd983f0db131483f0b27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.6.2

Release files / cv2imageload-1.0.6-py3-none-any.whl

Download URL cv2imageload-1.0.6-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0a0138361c9245f4c50cfc93643e35521bdd8edd6aec65606302ab4604f79721
BLAKE2b-256 checksum
How to use checksums
98b7b7a43394f179de0d23558dff9cd9d69877324e3c86ed102bf5c04a2767b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.6.2

Release history Release notifications | RSS feed

This release

1.0.6 This release

2 release files

1.0.5

2 release files

1.0.2

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page