c# ocr ok
Browse files
src/WpfEditor/MainWindow.xaml.cs
CHANGED
|
@@ -1065,7 +1065,7 @@ namespace WpfEditor
|
|
| 1065 |
|
| 1066 |
//OnOpenImage_Click(openFileDialog.FileName);
|
| 1067 |
|
| 1068 |
-
var (jsn, m5, pth_img, pth_json) = Global.img_md5_jsn(openFileDialog.FileName, OcrMode.
|
| 1069 |
|
| 1070 |
// 加载原图
|
| 1071 |
string b64_str = File.ReadAllText(pth_img, Encoding.UTF8);
|
|
|
|
| 1065 |
|
| 1066 |
//OnOpenImage_Click(openFileDialog.FileName);
|
| 1067 |
|
| 1068 |
+
var (jsn, m5, pth_img, pth_json) = Global.img_md5_jsn(openFileDialog.FileName, OcrMode.WeChatOcr);
|
| 1069 |
|
| 1070 |
// 加载原图
|
| 1071 |
string b64_str = File.ReadAllText(pth_img, Encoding.UTF8);
|
src/WpfEditor/global.cs
CHANGED
|
@@ -260,6 +260,14 @@ namespace WpfEditor
|
|
| 260 |
|
| 261 |
}
|
| 262 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 263 |
string b64_str = Base64.Base64Encode(pthimg);
|
| 264 |
|
| 265 |
DirectoryInfo di = Directory.CreateDirectory( Path.GetDirectoryName(pth_json) );
|
|
|
|
| 260 |
|
| 261 |
}
|
| 262 |
|
| 263 |
+
try
|
| 264 |
+
{
|
| 265 |
+
JObject.Parse(result);
|
| 266 |
+
} catch(Exception ex)
|
| 267 |
+
{
|
| 268 |
+
throw ex;
|
| 269 |
+
}
|
| 270 |
+
|
| 271 |
string b64_str = Base64.Base64Encode(pthimg);
|
| 272 |
|
| 273 |
DirectoryInfo di = Directory.CreateDirectory( Path.GetDirectoryName(pth_json) );
|