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

Loading image with DecoderOptions { MaxFrames = 1 } loads multiple frames for attached png file #2752

Closed
4 tasks done
danbystrom opened this issue Jun 18, 2024 · 0 comments
Closed
4 tasks done

Comments

@danbystrom
Copy link

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am running the latest version of ImageSharp
  • I have verified if the problem exist in both DEBUG and RELEASE mode
  • I have searched open and closed issues to ensure it has not already been reported

ImageSharp version

3.1.4

Other ImageSharp packages and versions

Environment (Operating system, version and so on)

Windows 11

.NET Framework version

net7.0

Description

Loading an image with the following statement:
using var img = await SixLabors.ImageSharp.Image.LoadAsync(new DecoderOptions { MaxFrames = 1 }, fileStream);
should just load one frame, which is does for all images I have tested on, EXCEPT the attached one, where it
imports all 42 frames.

Steps to Reproduce

Load the attached "duck.png" like this:

  using var fileStream = File.OpenRead(@"c:\temp\duck.png");
  using var img = await SixLabors.ImageSharp.Image.LoadAsync(new DecoderOptions { MaxFrames = 1 }, fileStream);
  Assert.AreEqual(1, img.Frames.Count);

Images

duck

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

No branches or pull requests

2 participants