From 9a6c6cce457e7dde688c7d53f52389c4884ecf2f Mon Sep 17 00:00:00 2001 From: ema Date: Tue, 6 Jan 2026 03:24:17 +0800 Subject: [PATCH] Fix tags not displayed due to empty cover art #1845 --- .../AudioTrack/CoverDataExtractor.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/AudioTrack/CoverDataExtractor.cs b/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/AudioTrack/CoverDataExtractor.cs index 275003d..39eb65d 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/AudioTrack/CoverDataExtractor.cs +++ b/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/AudioTrack/CoverDataExtractor.cs @@ -35,6 +35,8 @@ internal static class CoverDataExtractor /// Byte array of the cover image, or null if extraction fails. public static byte[] Extract(string base64strings) { + if (string.IsNullOrWhiteSpace(base64strings)) return null; + try { var coverData = base64strings.Trim(); @@ -68,6 +70,8 @@ internal static class CoverDataExtractor /// if successful; otherwise, null. public static BitmapSource Extract(byte[] coverBytes) { + if (coverBytes is null || coverBytes.Length is 0) return null; + // Supported formats: JPEG, PNG, BMP, GIF (first frame only), TIFF (first page only), ICO. // Not supported: WebP, HEIC/HEIF, AVIF, JPEG 2000, animated WebP/APNG, and other raw image formats (e.g., CR2, NEF).