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

+1 -1
View File
@@ -58,7 +58,7 @@
- (CIContext *)imgContext { - (CIContext *)imgContext {
if (!_imgContext) { if (!_imgContext) {
_imgContext = [CIContext contextWithCGContext:[[NSGraphicsContext currentContext] graphicsPort] _imgContext = [CIContext contextWithCGContext:[[NSGraphicsContext currentContext] CGContext]
options:nil]; options:nil];
} }
return _imgContext; return _imgContext;
+2 -2
View File
@@ -1109,7 +1109,7 @@ static void logCallback(MP4LogLevel loglevel, const char *fmt, va_list ap) {
hasAlpha:YES hasAlpha:YES
isPlanar:NO isPlanar:NO
colorSpaceName:NSCalibratedRGBColorSpace colorSpaceName:NSCalibratedRGBColorSpace
bitmapFormat:NSAlphaFirstBitmapFormat bitmapFormat:NSBitmapFormatAlphaFirst
bytesPerRow:0 bytesPerRow:0
bitsPerPixel:32]; bitsPerPixel:32];
[NSGraphicsContext saveGraphicsState]; [NSGraphicsContext saveGraphicsState];
@@ -1122,7 +1122,7 @@ static void logCallback(MP4LogLevel loglevel, const char *fmt, va_list ap) {
[NSGraphicsContext restoreGraphicsState]; [NSGraphicsContext restoreGraphicsState];
imageData = [bitmap representationUsingType:NSJPEGFileType properties:@{}]; imageData = [bitmap representationUsingType:NSBitmapImageFileTypeJPEG properties:@{}];
} }
MP4WriteSample(self.fileHandle, MP4WriteSample(self.fileHandle,
+1 -1
View File
@@ -1100,7 +1100,7 @@
if (representations.count) { if (representations.count) {
NSData *bitmapData = [NSBitmapImageRep representationOfImageRepsInArray:representations NSData *bitmapData = [NSBitmapImageRep representationOfImageRepsInArray:representations
usingType:NSPNGFileType properties:@{}]; usingType:NSBitmapImageFileTypePNG properties:@{}];
if (bitmapData) { if (bitmapData) {
newArtwork.data = (void *)bitmapData.bytes; newArtwork.data = (void *)bitmapData.bytes;
+4 -5
View File
@@ -19,16 +19,15 @@ public:
OCRWrapper(const char *lang, const char *base_path) { OCRWrapper(const char *lang, const char *base_path) {
@autoreleasepool { @autoreleasepool {
NSString *path = nil; NSString *path = nil;
if (base_path) if (base_path) {
path = [[NSString stringWithUTF8String:base_path] stringByAppendingString:@"/"]; path = [[NSString stringWithUTF8String:base_path] stringByAppendingString:@"/"];
else } else {
path = [[[NSBundle bundleForClass:[MP42OCRWrapper class]] bundlePath] stringByAppendingString:@"/Versions/A/Resources/"]; path = [[[NSBundle bundleForClass:[MP42OCRWrapper class]] bundlePath] stringByAppendingString:@"/Versions/A/Resources/"];
}
setenv("TESSDATA_PREFIX", [path UTF8String], 1);
path = [path stringByAppendingString:@"tessdata/"]; path = [path stringByAppendingString:@"tessdata/"];
tess_base_api.Init([path UTF8String], lang, OEM_DEFAULT); tess_base_api.Init(path.UTF8String, lang, OEM_DEFAULT);
} }
} }