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 {
if (!_imgContext) {
_imgContext = [CIContext contextWithCGContext:[[NSGraphicsContext currentContext] graphicsPort]
_imgContext = [CIContext contextWithCGContext:[[NSGraphicsContext currentContext] CGContext]
options:nil];
}
return _imgContext;
+2 -2
View File
@@ -1109,7 +1109,7 @@ static void logCallback(MP4LogLevel loglevel, const char *fmt, va_list ap) {
hasAlpha:YES
isPlanar:NO
colorSpaceName:NSCalibratedRGBColorSpace
bitmapFormat:NSAlphaFirstBitmapFormat
bitmapFormat:NSBitmapFormatAlphaFirst
bytesPerRow:0
bitsPerPixel:32];
[NSGraphicsContext saveGraphicsState];
@@ -1122,7 +1122,7 @@ static void logCallback(MP4LogLevel loglevel, const char *fmt, va_list ap) {
[NSGraphicsContext restoreGraphicsState];
imageData = [bitmap representationUsingType:NSJPEGFileType properties:@{}];
imageData = [bitmap representationUsingType:NSBitmapImageFileTypeJPEG properties:@{}];
}
MP4WriteSample(self.fileHandle,
+1 -1
View File
@@ -1100,7 +1100,7 @@
if (representations.count) {
NSData *bitmapData = [NSBitmapImageRep representationOfImageRepsInArray:representations
usingType:NSPNGFileType properties:@{}];
usingType:NSBitmapImageFileTypePNG properties:@{}];
if (bitmapData) {
newArtwork.data = (void *)bitmapData.bytes;
+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);
}
}