Fix #669: convert image to sRGB only when the original ColorSpace is RGB, sRGB, or scRGB

This commit is contained in:
Paddy Xu
2020-07-05 12:30:37 +02:00
parent cbd137d075
commit fe44021590

View File

@@ -96,7 +96,11 @@ namespace QuickLook.Plugin.ImageViewer.AnimatedImage.Providers
using (var mi = new MagickImage(Path, settings)) using (var mi = new MagickImage(Path, settings))
{ {
var profile = mi.GetColorProfile(); var profile = mi.GetColorProfile();
if (profile?.Description != null && !profile.Description.Contains("sRGB")) if (mi.ColorSpace == ColorSpace.RGB ||
mi.ColorSpace == ColorSpace.sRGB ||
mi.ColorSpace == ColorSpace.scRGB &&
profile?.Description != null &&
!profile.Description.Contains("sRGB"))
mi.SetProfile(ColorProfile.SRGB); mi.SetProfile(ColorProfile.SRGB);
mi.AutoOrient(); mi.AutoOrient();