mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-02 02:44:41 +00:00
Compare commits
3 Commits
14a5bea926
...
copilot/fi
Author | SHA1 | Date | |
---|---|---|---|
![]() |
19388c89a8 | ||
![]() |
e017b3200d | ||
![]() |
de35ea77bc |
@@ -105,13 +105,30 @@ internal class ImageMagickProvider : AnimationProvider
|
||||
{
|
||||
mi = layers[0];
|
||||
}
|
||||
if (SettingHelper.Get("UseColorProfile", false, "QuickLook.Plugin.ImageViewer"))
|
||||
if (SettingHelper.Get("UseColorProfile", true, "QuickLook.Plugin.ImageViewer"))
|
||||
{
|
||||
if (mi.ColorSpace == ColorSpace.RGB || mi.ColorSpace == ColorSpace.sRGB || mi.ColorSpace == ColorSpace.scRGB)
|
||||
try
|
||||
{
|
||||
mi.SetProfile(ColorProfile.SRGB);
|
||||
if (ContextObject.ColorProfileName != null)
|
||||
mi.SetProfile(new ColorProfile(ContextObject.ColorProfileName)); // map to monitor color
|
||||
// Apply color management for any color space that has embedded color profiles
|
||||
// This includes Display P3, Adobe RGB, ProPhoto RGB, and other wide-gamut spaces
|
||||
if (mi.HasColorProfile)
|
||||
{
|
||||
// If the image already has a color profile, preserve it and convert to monitor color space
|
||||
if (ContextObject.ColorProfileName != null)
|
||||
mi.SetProfile(new ColorProfile(ContextObject.ColorProfileName)); // map to monitor color
|
||||
}
|
||||
else if (mi.ColorSpace == ColorSpace.RGB || mi.ColorSpace == ColorSpace.sRGB || mi.ColorSpace == ColorSpace.scRGB)
|
||||
{
|
||||
// For images without embedded profiles, assume sRGB and convert to monitor color space
|
||||
mi.SetProfile(ColorProfile.SRGB);
|
||||
if (ContextObject.ColorProfileName != null)
|
||||
mi.SetProfile(new ColorProfile(ContextObject.ColorProfileName)); // map to monitor color
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
ProcessHelper.WriteLog($"Color profile conversion failed: {e}");
|
||||
// Continue without color management if it fails
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -65,7 +65,7 @@ public class Plugin : IViewer
|
||||
|
||||
public void Init()
|
||||
{
|
||||
var useColorProfile = SettingHelper.Get("UseColorProfile", false, "QuickLook.Plugin.ImageViewer");
|
||||
var useColorProfile = SettingHelper.Get("UseColorProfile", true, "QuickLook.Plugin.ImageViewer");
|
||||
|
||||
AnimatedImage.AnimatedImage.Providers.Add(
|
||||
new KeyValuePair<string[], Type>(
|
||||
|
Reference in New Issue
Block a user