Use deprecated methods for macOS <10.12 --- src/nsimage.mm +++ src/nsimage.mm @@ -100,7 +100,7 @@ static NSImage *DoResize(NSImage *sourceImage, NSSize newSize) { graphicsContextWithBitmapImageRep:rep]]; [sourceImage drawInRect:NSMakeRect(0, 0, newSize.width, newSize.height) fromRect:NSZeroRect - operation:NSCompositingOperationCopy + operation:NSCompositeCopy fraction:1.0]; [NSGraphicsContext restoreGraphicsState]; @@ -117,6 +117,7 @@ bool ResizeGivenImage(const char *filePath, NSImage *source = [[NSImage alloc] initWithContentsOfFile:[NSString stringWithUTF8String:filePath]]; + [source setScalesWhenResized:YES]; if (source == nil) { fprintf(stderr, "Image '%s' could not be loaded.\n", filePath); exit(1); @@ -223,10 +224,10 @@ bool ResizeGivenImage(const char *filePath, NSDictionary *props; if ((isPNG && !myPicPrefs.allJPEG) || myPicPrefs.allPNG) { - filetype = NSBitmapImageFileTypePNG; + filetype = NSPNGFileType; props = nil; } else { - filetype = NSBitmapImageFileTypeJPEG; + filetype = NSJPEGFileType; props = [NSDictionary dictionaryWithObject:[NSNumber numberWithFloat:0.7] forKey:NSImageCompressionFactor]; } @@ -236,7 +237,7 @@ bool ResizeGivenImage(const char *filePath, int iter = 0; float compression = 0.65; if ((myPicPrefs.max_Kbytes != 0) && - (filetype == NSBitmapImageFileTypeJPEG)) { + (filetype == NSJPEGFileType)) { while ((dataLength > (unsigned)myPicPrefs.max_Kbytes) && (iter < 10)) { props = [NSDictionary dictionaryWithObject:[NSNumber numberWithFloat:compression]