From fceee358968b6335cd1680c35249126e60cf5af2 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Tue, 5 Jul 2022 23:44:35 -0700 Subject: [PATCH] [Album Art] macOS Ventura natively supports AVIF Disable the compiled in AVIF support there, as the OS supports it natively. Keep the libraries for older OSes. Signed-off-by: Christopher Snowhill --- Playlist/PlaylistEntry.m | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Playlist/PlaylistEntry.m b/Playlist/PlaylistEntry.m index c82a01f98..fa0ad0b31 100644 --- a/Playlist/PlaylistEntry.m +++ b/Playlist/PlaylistEntry.m @@ -324,14 +324,18 @@ extern NSMutableDictionary *kArtworkDictionary; NSImage *image = [NSImage imageNamed:imageCacheTag]; if(image == nil) { - if([AVIFDecoder isAVIFFormatForData:self.albumArtInternal]) { - CGImageRef imageRef = [AVIFDecoder createAVIFImageWithData:self.albumArtInternal]; - if(imageRef) { - image = [[NSImage alloc] initWithCGImage:imageRef size:NSZeroSize]; - CFRelease(imageRef); - } - } else { + if(@available(macOS 13.0, *)) { image = [[NSImage alloc] initWithData:self.albumArtInternal]; + } else { + if([AVIFDecoder isAVIFFormatForData:self.albumArtInternal]) { + CGImageRef imageRef = [AVIFDecoder createAVIFImageWithData:self.albumArtInternal]; + if(imageRef) { + image = [[NSImage alloc] initWithCGImage:imageRef size:NSZeroSize]; + CFRelease(imageRef); + } + } else { + image = [[NSImage alloc] initWithData:self.albumArtInternal]; + } } [image setName:imageCacheTag]; }