Get the properties of HEIC image in asp.net core
Clash Royale CLAN TAG#URR8PPP
Get the properties of HEIC image in asp.net core
I wanted to get the properties such as width, height, format of HEIC image file in asp.net core. For other images, I am using BitMap to find this information as below.
FileDetail fileProp = new FileDetail();
using (Bitmap bmp = new Bitmap(file.OpenReadStream()))
fileProp.FileName = file.Name;
fileProp.Dimension = bmp.Width + " X " + bmp.Height;
fileProp.Size = file.Length;
fileProf.Format = bmp.RawFormat;
Thank you in advance.
1 Answer
1
HEIC is license-encumbered, and therefore, support is minimal. I'm not aware of any C# library that supports it. However, it's possible you could drop to the shell and get the information you require there, but again, you'd need an OS with support. That's pretty much just MacOS and reportedly some unspecified SKUs of Windows 10 (likely just Pro or Enterprise). Since it's fairly unlikely you'll actually be hosting a website on any of those, though, it's probably a moot point. Long and short, you probably just need to force your users to give you a standard image format instead, or if it's your own files, convert them to something like JPEG yourself.
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.