Skip to content

Commit 4ea54cb

Browse files
committed
fixed: gif animation is broken due to #2182
1 parent 92f9c97 commit 4ea54cb

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

Source/Components/ImageGlass.Base/Photoing/Codecs/PhotoCodec.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,20 @@ private static (bool loadSuccessful, IgImgData result, string ext, MagickReadSet
888888
try
889889
{
890890
// Note: Using WIC is much faster than using MagickImageCollection
891-
result.Source = WicBitmapDecoder.Load(filePath);
891+
if (result.CanAnimate)
892+
{
893+
result.Source = BHelper.ToGdiPlusBitmap(filePath);
894+
}
895+
// multiple frame
896+
else if (result.FrameCount > 0)
897+
{
898+
result.Source = WicBitmapDecoder.Load(filePath);
899+
}
900+
// single frame
901+
else
902+
{
903+
result.Image = WicBitmapSource.Load(filePath);
904+
}
892905
}
893906
catch
894907
{

0 commit comments

Comments
 (0)