Fix #292: Handle possible exception when changing colour profile

This commit is contained in:
Paddy Xu
2018-07-14 17:44:18 +03:00
parent f0131a36ac
commit 1ae40a0019

View File

@@ -53,7 +53,15 @@ namespace QuickLook.Plugin.ImageViewer.AnimatedImage
{
using (var image = new MagickImage(_path))
{
image.AddProfile(ColorProfile.SRGB);
try
{
image.AddProfile(ColorProfile.SRGB);
}
catch (MagickResourceLimitErrorException)
{
// https://github.com/xupefei/QuickLook/issues/292: ColorspaceColorProfileMismatch
}
image.Density = new Density(Math.Floor(image.Density.X), Math.Floor(image.Density.Y));
image.AutoOrient();