From 40107a9db1c695ae11b5e676dda5093535e2d10b Mon Sep 17 00:00:00 2001 From: Damiano Galassi Date: Fri, 25 Sep 2026 07:48:42 +0200 Subject: [PATCH] Fix the jpeg check on macOS 11 and later Fix #151. --- Classes/PropertyView/MovieViewController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/PropertyView/MovieViewController.swift b/Classes/PropertyView/MovieViewController.swift index 9b9544a..59a94ec 100644 --- a/Classes/PropertyView/MovieViewController.swift +++ b/Classes/PropertyView/MovieViewController.swift @@ -905,12 +905,12 @@ class MovieViewController: PropertyView, NSTableViewDataSource, ExpandedTableVie private func add(artworks: [Any], toIndexPath: IndexPath) -> Bool { let items = artworks.compactMap { (artwork: Any) -> MP42Image? in if let url = artwork as? URL { - let value = try? url.resourceValues(forKeys: [URLResourceKey.typeIdentifierKey]) - var isJpeg = false if #available(macOS 11, *) { + let value = try? url.resourceValues(forKeys: [URLResourceKey.contentTypeKey]) isJpeg = value?.contentType?.conforms(to: .jpeg) ?? false } else { + let value = try? url.resourceValues(forKeys: [URLResourceKey.typeIdentifierKey]) if let type = value?.typeIdentifier, UTTypeConformsTo(type as CFString, "public.jpeg" as CFString) { isJpeg = true }