问题
I'm having trouble with HEIC image format in my team's project. Currently we are grabbing the bytearray of the image date and displaying it into our mobile app, but other issues occur when we want to do more with the image format.
Is it possible to convert the HEIC bytearray to some other format like PNG bytearray?
Here's what I got
private async Task ProcessPhotos(IList<Models.MediaFile> mediaFiles)
{
Debug.WriteLine(DateTime.Now.CurrentTimeWithMilliSeconds(), "Process Photos Start");
foreach (var mediaFile in mediaFiles)
{
var editImageModel = new EditImageModel();
editImageModel.SourceImage = System.IO.File.ReadAllBytes(mediaFile.Path);
editImageModel.EditedImage = editImageModel.SourceImage;
/*I want to convert the bytearray here*/
await ProcessUpdatedImage(editImageModel);
}
Debug.WriteLine(DateTime.Now.CurrentTimeWithMilliSeconds(), "Process Photos End");
}
来源:https://stackoverflow.com/questions/59990667/convert-heic-bytearray-to-jpg-png-bytearray