I have tested using Aspose.Imaging for .NET 20.5 and there is no issue my end while accessing the image width and height. Please observe the attached snapshot image for properties and console output.
We are running the same code but getting different result, so there must be some other factor. Do you have any ideas why the Width & Height properties are returning different values on my computers than on yours?
Can you please possibly provide the working sample Visual Studio project you are using along with information about Windows version and Screen resolution settings you have. I may use this information to contact our team for possible reason.
I have worked with new image and it has reproduced the issue on my end. A ticket with ID IMAGINGNET-3957 has been created to investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.
Can you please try using latest Aspose.Imaging for .NET 21.2. Actually, the second image (input_new.jpg) is stored as image with dimensions 3648x2736, but it also has EXIF tag ExifOrientation.LeftBottom, which says that we must rotate image by 90 degrees.
By default we load the image as is, without any changes. If you wish to apply EXIT information to image, you should use following code:
using (var img = Aspose.Imaging.Image.Load("input.jpg"))
{
// if image has EXIF orientation info than apply it
if (img is JpegImage jpegImage)
jpegImage.AutoRotate();
Console.WriteLine("Width: " + img.Width);
Console.WriteLine("Height: " + img.Height);
}
using (var img = (JpegImage)Aspose.Imaging.Image.Load("input_new.jpg"))
{
// if image has EXIF orientation info than apply it
if (img is JpegImage jpegImage)
jpegImage.AutoRotate();
Console.WriteLine("Width: " + img.Width);
Console.WriteLine("Height: " + img.Height);
}