fix deprecations.

This commit is contained in:
Damiano Galassi committed 2019-02-05 10:10:48 +01:00
1 parent 9cea3be041
commit 7870edbaaf
4 files changed
+8 -9

No files matched your search

+4 -5
View File
@@ -19,16 +19,15 @@ public:
OCRWrapper(const char *lang, const char *base_path) {
@autoreleasepool {
NSString *path = nil;
if (base_path)
if (base_path) {
path = [[NSString stringWithUTF8String:base_path] stringByAppendingString:@"/"];
else
} else {
path = [[[NSBundle bundleForClass:[MP42OCRWrapper class]] bundlePath] stringByAppendingString:@"/Versions/A/Resources/"];
setenv("TESSDATA_PREFIX", [path UTF8String], 1);
}
path = [path stringByAppendingString:@"tessdata/"];
tess_base_api.Init([path UTF8String], lang, OEM_DEFAULT);
tess_base_api.Init(path.UTF8String, lang, OEM_DEFAULT);
}
}