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

Identify fails on image that can be loaded without error #1221

Closed
4 tasks done
eelke-at-bolt opened this issue Jun 9, 2020 · 0 comments · Fixed by #1226
Closed
4 tasks done

Identify fails on image that can be loaded without error #1221

eelke-at-bolt opened this issue Jun 9, 2020 · 0 comments · Fixed by #1226

Comments

@eelke-at-bolt
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

Description

When I call SixLabors.ImageSharp.Image.Identify on certain jpeg's this result in the following error.

SixLabors.ImageSharp.InvalidImageContentException: Multiple SOF markers. Only single frame jpegs supported.
   at SixLabors.ImageSharp.Formats.Jpeg.JpegThrowHelper.ThrowInvalidImageContentException(String errorMessage)
   at SixLabors.ImageSharp.Formats.Jpeg.JpegDecoderCore.ProcessStartOfFrameMarker(Int32 remaining, JpegFileMarker& frameMarker, Boolean metadataOnly)
   at SixLabors.ImageSharp.Formats.Jpeg.JpegDecoderCore.ParseStream(Stream stream, Boolean metadataOnly)
   at SixLabors.ImageSharp.Formats.Jpeg.JpegDecoderCore.Identify(Stream stream)
   at SixLabors.ImageSharp.Formats.Jpeg.JpegDecoder.Identify(Configuration configuration, Stream stream)
   at SixLabors.ImageSharp.Image.InternalIdentity(Stream stream, Configuration config)
   at SixLabors.ImageSharp.Image.<>c__DisplayClass87_0.<Identify>b__0(Stream s)
   at SixLabors.ImageSharp.Image.WithSeekableStream[T](Configuration configuration, Stream stream, Func`2 action)
   at SixLabors.ImageSharp.Image.Identify(Configuration configuration, Stream stream, IImageFormat& format)
   at SixLabors.ImageSharp.Image.Identify(Stream stream, IImageFormat& format)
   at SixLabors.ImageSharp.Image.Identify(Stream stream)

Steps to Reproduce

Calling Identify on attached file fails

5acshwaw6agp3q6aoaofe5wvj4kvqcq4

using System;

namespace imageTest
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                var img = SixLabors.ImageSharp.Image.Identify(@"5acshwaw6agp3q6aoaofe5wvj4kvqcq4.jpg");
                if (img != null)
                {
                    Console.WriteLine("Succes!");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }
    }
}

Doing Load on same image succeeds.

System Configuration

  • ImageSharp version: 1.0.0-rc0002
  • Other ImageSharp packages and versions: none
  • Environment (Operating system, version and so on): Windows 10
  • .NET Framework version: .net core 3.1
  • Additional information:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants