如何解决如何在ios flutter应用程序中将webp图像转换并保存到相册
我想将网络上的webp图像保存到iphones图片库。我尝试了软件包gallery_saver
和image_gallery_saver
。两者都不输出错误消息,所以我不知道为什么它不起作用。我试图用FlutterImageCompress
转换图像。我也尝试了jpeg和png。
Directory tempDir = await getTemporaryDirectory();
String srcPath = tempDir.path + '/src.webp';
String destPath = tempDir.path + '/dest.jpg';
await Dio().download(url,srcPath);
await FlutterImageCompress.compressAndGetFile(srcPath,destPath,quality: 95,autoCorrectionAngle: true,format: CompressFormat.jpeg);
result = await ImageGallerySaver.saveFile(destPath);
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。