Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot load animated avif images. #1526

Open
GoldenGuy opened this issue Jan 20, 2024 · 3 comments
Open

Cannot load animated avif images. #1526

GoldenGuy opened this issue Jan 20, 2024 · 3 comments

Comments

@GoldenGuy
Copy link

Magick.NET version

13.5.0

Environment (Operating system, version and so on)

Win10 pro 22H2 x64

Description

i am able to load static avif/heic imageges, but any animated image i tried i got this exception:

Unhandled exception. ImageMagick.MagickMissingDelegateErrorException: no decode delegate for this image format `' @ error/blob.c/CustomStreamToImage/810
   at ImageMagick.NativeInstance.CheckException(IntPtr exception, IntPtr result) in /_/src/Magick.NET/Native/NativeInstance.cs:line 57
   at ImageMagick.MagickImage.NativeMagickImage.ReadStream(IMagickSettings`1 settings, ReadWriteStreamDelegate reader, SeekStreamDelegate seeker, TellStreamDelegate teller) in /_/src/Magick.NET/Native/MagickImage.cs:line 7037
   at ImageMagick.MagickImage.Read(Stream stream, IMagickReadSettings`1 readSettings, Boolean ping) in /_/src/Magick.NET/MagickImage.cs:line 7635
   at ImageMagick.MagickImage.Ping(Stream stream, IMagickReadSettings`1 readSettings) in /_/src/Magick.NET/MagickImage.cs:line 4549
   at ImageMagick.MagickImageInfo.Read(Stream stream, IMagickReadSettings`1 readSettings) in /_/src/Magick.NET/MagickImageInfo.cs:line 406
   at ImageMagick.MagickImageInfo..ctor(Stream stream, IMagickReadSettings`1 readSettings) in /_/src/Magick.NET/MagickImageInfo.cs:line 133
   at ImageMagick.MagickImageInfo..ctor(Stream stream) in /_/src/Magick.NET/MagickImageInfo.cs:line 121
   at TwitchChat.ImageDownloader.DownloadImage(String name, String url) in D:\VS\TwitchChat\ImageDownloader.cs:line 42
   at TwitchChat.Program.Main(String[] args) in D:\VS\TwitchChat\Program.cs:line 67
   at TwitchChat.Program.<Main>(String[] args)

Steps to Reproduce

here is my code

byte[] imageData = await httpClient.GetByteArrayAsync(url);
using (MemoryStream inputStream = new MemoryStream(imageData))
{
	var info = new ImageMagick.MagickImageInfo(inputStream);
	Console.WriteLine($"format: {info.Format}");
}

test images i used are these:
https://github.com/colinbendell/webperf/tree/master/animated-gif-decode
and these:
https://github.com/link-u/avif-sample-images

@dlemstra
Copy link
Owner

It looks like animated avif images are not yet supported by the library that is being used in this project: strukturag/libheif#377.

@GoldenGuy
Copy link
Author

Maybe libavif could be used for this? Doesnt seem like there is any progress in libheif to add support for animated avis...

@dlemstra
Copy link
Owner

That library is being used by libheif to read avif files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants