@@ -82,7 +82,6 @@ bool ResizeGivenImage(const char *filePath,
82
82
83
83
NSImage *source = [[NSImage alloc ]
84
84
initWithContentsOfFile: [NSString stringWithUTF8String: filePath]];
85
- [source setScalesWhenResized: YES ];
86
85
if (source == nil ) {
87
86
fprintf (stderr, " Image '%s' could not be loaded.\n " , filePath);
88
87
exit (1 );
@@ -192,7 +191,7 @@ bool ResizeGivenImage(const char *filePath,
192
191
NSEraseRect (destinationRect);
193
192
[source drawInRect: destinationRect
194
193
fromRect: destinationRect
195
- operation: NSCompositeCopy
194
+ operation: NSCompositingOperationCopy
196
195
fraction: 1.0 ];
197
196
198
197
NSBitmapImageRep *bitmap =
@@ -201,11 +200,11 @@ bool ResizeGivenImage(const char *filePath,
201
200
NSDictionary *props;
202
201
203
202
if ((isPNG && !myPicPrefs.allJPEG ) || myPicPrefs.allPNG ) {
204
- filetype = NSPNGFileType ;
203
+ filetype = NSBitmapImageFileTypePNG ;
205
204
props = nil ;
206
205
207
206
} else {
208
- filetype = NSJPEGFileType ;
207
+ filetype = NSBitmapImageFileTypeJPEG ;
209
208
props = [NSDictionary dictionaryWithObject: [NSNumber numberWithFloat: 0.7 ]
210
209
forKey: NSImageCompressionFactor ];
211
210
}
@@ -215,7 +214,8 @@ bool ResizeGivenImage(const char *filePath,
215
214
216
215
int iter = 0 ;
217
216
float compression = 0.65 ;
218
- if ((myPicPrefs.max_Kbytes != 0 ) && (filetype == NSJPEGFileType )) {
217
+ if ((myPicPrefs.max_Kbytes != 0 ) &&
218
+ (filetype == NSBitmapImageFileTypeJPEG)) {
219
219
while ((dataLength > (unsigned )myPicPrefs.max_Kbytes ) && (iter < 10 )) {
220
220
props = [NSDictionary
221
221
dictionaryWithObject: [NSNumber numberWithFloat: compression]
0 commit comments