diff options
Diffstat (limited to 'macosx/HBThumbnailItemView.m')
-rw-r--r-- | macosx/HBThumbnailItemView.m | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/macosx/HBThumbnailItemView.m b/macosx/HBThumbnailItemView.m index 9a96bda0f..21f8e7ac6 100644 --- a/macosx/HBThumbnailItemView.m +++ b/macosx/HBThumbnailItemView.m @@ -63,28 +63,24 @@ _imageView.hidden = YES; - dispatch_async(dispatch_get_global_queue(QOS_CLASS_BACKGROUND, 0), ^{ - HBPreviewGenerator *generator = self.generator; - - [generator copySmallImageAtIndex:thumbnailIndex completionHandler:^(CGImageRef _Nullable result) - { - if (result != NULL) - { - NSSize size = NSMakeSize(CGImageGetWidth(result), CGImageGetHeight(result)); - NSImage *thumbnail = [[NSImage alloc] initWithCGImage:result size:size]; - - dispatch_async(dispatch_get_main_queue(), ^{ - [self setThumbnail:thumbnail]; - }); - } - else - { - dispatch_async(dispatch_get_main_queue(), ^{ - [self setThumbnail:nil]; - }); - } - }]; - }); + [self.generator copySmallImageAtIndex:thumbnailIndex completionHandler:^(CGImageRef _Nullable result) + { + if (result != NULL) + { + NSSize size = NSMakeSize(CGImageGetWidth(result), CGImageGetHeight(result)); + NSImage *thumbnail = [[NSImage alloc] initWithCGImage:result size:size]; + + dispatch_async(dispatch_get_main_queue(), ^{ + [self setThumbnail:thumbnail]; + }); + } + else + { + dispatch_async(dispatch_get_main_queue(), ^{ + [self setThumbnail:nil]; + }); + } + }]; } @end |