Convert HEIC bytearray to JPG/PNG bytearray

廉价感情. 提交于 2020-02-16 10:29:49

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!