Support .icns image #1480

This commit is contained in:
ema
2024-12-15 05:34:50 +08:00
parent cd35e05461
commit 32a1d709a5
4 changed files with 873 additions and 5 deletions

View File

@@ -82,11 +82,20 @@ public class MetaProvider
// fallback
using (var mi = new MagickImage())
try
{
mi.Ping(_path);
w = (int)mi.Width;
h = (int)mi.Height;
using (var mi = new MagickImage())
{
mi.Ping(_path);
w = (int)mi.Width;
h = (int)mi.Height;
}
}
catch
{
// There are always formats that MagickImage does not support
// TODO: Use MediaInfo to detect it?
return Size.Empty;
}
return w + h == 0 ? new Size(800, 600) : new Size(w, h);