When i use the AutoRotate() Method on a JpegImage the method throws an exception:
System.ArgumentOutOfRangeException
HResult=0x80131502
Message=Specified argument was out of the range of valid values.
Source=Aspose.Imaging
StackTrace:
at Aspose.Imaging.FileFormats.Jpeg.JpegImage.AutoRotate()
at AutoRotateBug.Program.Main(String[] args) in D:\dev\Tryout\AutoRotateBug\AutoRotateBug\Program.cs:line 14
This works correctly on most jpg but not on the one attached.
Code to trigger the exception:
static void Main(string[] args)
{
var image = Aspose.Imaging.Image.Load(“49.jpg”);
if (image is Aspose.Imaging.FileFormats.Jpeg.JpegImage inputJpegImage)
{
if (inputJpegImage.JpegOptions?.ExifData?.Orientation != Aspose.Imaging.Exif.Enums.ExifOrientation.TopLeft)
{
inputJpegImage.AutoRotate();
}
}
}
49.jpg (2.6 MB)
The Aspose Imaging version is 22.5
Could you check if this is an known error?
Regards,
Mark Krommenhoek
(this look the same as JpegImage.autoRotate() throws Exception on some Jpeg images - #4 by mudassir.fayyaz but there is no solution in this topic)
ad. The forum software seems to adjust the attached jpg… I also have uploaded a zipfile with the image.49.zip (4.1 MB)