简体   繁体   English

Flutter NetworkImage 无法从 url 加载 HEIC 图像

[英]Flutter NetworkImage failed to load HEIC image from url

In my NetworkImage my url is this https://joylist.s3.us-east-2.amazonaws.com/profile/5f229e9cfa3dc8542f815cb9.HEIC在我的 NetworkImage 中,我的网址是https://joylist.s3.us-east-2.amazonaws.com/profile/5f229e9cfa3dc8542f815cb9.HEIC

And it throws this exception它抛出这个异常在此处输入图片说明

It worked fine with .jpg or png and other formats.它适用于 .jpg 或 png 和其他格式。 Now, How can I resolve this and show this image.现在,我该如何解决并显示此图像。

You can work with the heic to jpg library ( https://pub.dev/packages/heic_to_jpg ) to achieve this (Except that you're specifically looking to show HEIC images).您可以使用 heic to jpg 库 ( https://pub.dev/packages/heic_to_jpg ) 来实现这一点(除非您特别希望显示 HEIC 图像)。

Add the package:添加包:

dependencies:
  heic_to_jpg: ^0.1.2

Import the package in your dart file:在 dart 文件中导入包:

import 'package:heic_to_jpg/heic_to_jpg.dart';

And call convert method with local HEIC/HEIF image file path.并使用本地 HEIC/HEIF 图像文件路径调用转换方法。

String jpegPath = await HeicToJpg.convert(heicPath);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM