Sorry for the duplicate, I just created a pull request.
Hi,
we are getting ArgumentExceptions in the ImageDimensionService when using progressive JPGs. In DecodeJfif you are looking for a 0xc0 marker which is only valid for baseline jpgs. For progressive jpgs it should be 0xc2.
Additionally I would suggest that you replace the throw new ArgumentException(ErrorMessage); with return Size.Empty; so the fallback Image.FromStream can be used.
Keep in mind that you need to reset the stream position to the beginning (stream.Position = 0;) right before the Image.FromStream because the BinaryReader has already read some bytes.
Sorry for the duplicate, I just created a pull request.
Hi,
we are getting ArgumentExceptions in the ImageDimensionService when using progressive JPGs. In DecodeJfif you are looking for a 0xc0 marker which is only valid for baseline jpgs. For progressive jpgs it should be 0xc2.
Additionally I would suggest that you replace the throw new ArgumentException(ErrorMessage); with return Size.Empty; so the fallback Image.FromStream can be used. Keep in mind that you need to reset the stream position to the beginning (stream.Position = 0;) right before the Image.FromStream because the BinaryReader has already read some bytes.
Regards, Benjamin