mirror of
https://github.com/RapidAI/RapidOCR.git
synced 2026-11-10 21:10:55 +08:00
fix: fixed issue #528
This commit is contained in:
1 parent
af65796b78
commit
a0bb926500
1 file changed
+5
@@ -4,6 +4,7 @@
|
||||
import hashlib
|
||||
import importlib
|
||||
from pathlib import Path
|
||||
from sys import platform
|
||||
from typing import Tuple, Union
|
||||
from urllib.parse import urlparse
|
||||
|
||||
@@ -44,6 +45,10 @@ def save_img(save_path: Union[str, Path], img: np.ndarray):
|
||||
if not Path(save_path).parent.exists():
|
||||
Path(save_path).parent.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
if platform.startswith("win32"):
|
||||
cv2.imencode(Path(save_path).suffix, img)[1].tofile(str(save_path))
|
||||
return
|
||||
|
||||
cv2.imwrite(str(save_path), img)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user