-
-
Notifications
You must be signed in to change notification settings - Fork 413
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
MagickImage cannot detect correct image format with ReadAsync
#1174
Comments
Thanks for reporting this I just pushed a fix for this issue that will be resolved in the next release. |
I hope this fix can be released some time this week, or else I will miss it for ImageGlass 9.0 beta 1 🕊 |
Hi @dlemstra, The bug still persists when using using var imgColl = new MagickImageCollection();
// ❌ CANNOT detect format
settings.Format = MagickFormat.Ico;
await imgColl.ReadAsync(filename, settings, cancelToken);
// ✅ CAN detect format
await imgColl.ReadAsync(filename, settings, cancelToken);
// ✅ CAN detect format
imgColl.Read(filename, settings); I checked the MagickImageCollection source code a bit, and found this: Magick.NET/src/Magick.NET/Netstandard21/MagickImageCollection.cs Lines 292 to 301 in 8a4f9de
Magick.NET/src/Magick.NET/Netstandard21/MagickImageCollection.cs Lines 582 to 601 in 8a4f9de
|
Seems that I only fixed this in the |
Magick.NET version
11.1.0 - Magick.NET-Q16-OpenMP-x64
Environment (Operating system, version and so on)
Windows 10 21H2
Description
<MagickImage>.ReadAsync()
and<MagickImageCollection>.ReadAsync()
function.ReadAsync
because it supportsCancellationToken
, and it's convenient to do some quick check before loading entire image file which is time-consuming.Steps to Reproduce
Code produces error:
Code without error:
Solution 1: Directly pass filename to constructor
Solution 2: Tell what the format is
You can access full source code at:
https://github.com/d2phap/ImageGlass/blob/v9/v9/IgCodecs/ImageMagickIgCodec/Main.cs#L493
The text was updated successfully, but these errors were encountered: