Skip to content

Commit a0cbc96

Browse files
committed
fix png to base64
1 parent f948315 commit a0cbc96

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

image_utils/convert.py

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def base64_cv2(b64, is_color=True):
3636
:param is_color bool 是否为彩色图像,若为True则返回彩色图像,否则返回灰度图像
3737
:return numpy.ndarray cv2图像
3838
"""
39+
b64 = re.sub('^data:image/.+;base64,', '', b64)
3940
b64 = base64.b64decode(b64)
4041
nparr = np.fromstring(b64, np.uint8)
4142
color = cv2.IMREAD_COLOR if is_color else cv2.IMREAD_GRAYSCALE

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
'numpy',
2020
]
2121

22-
VERSION = '0.3.2'
22+
VERSION = '0.3.3'
2323
URL = 'https://github.com/cyy0523xc/python-image-utils'
2424

2525
setup(

0 commit comments

Comments
 (0)