Any idea on how to get an image dimensions in asp.net core, knowing that System.Drawing.Image doesn't work on this version. This is how I am actually reading the image:
byte[] data = File.ReadAllBytes("path_to_image");
return data;
ie: Can I find the Height and Width of an image in its byte[] representaion?
Any help in how to rotate the image is also welcome.
You want bytes 11-12 for Horizontal resolution, and 13-14 for Vertical resolution. Assuming you're talking about a JPEG image. And byte 10 gives you the unit type (dots per inch or dots per cm)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.