如何在颤动中获取exif方向值

问题描述 投票:1回答:1

我正在使用Flutter开发一个应用,我想检索使用image_picker插件选择的图像的exif方向值。

[当我运行下面的代码并选择预先旋转的图像时,方向值将为null,exif数据将为空Map。

File file = await ImagePicker.pickImage(
  source: ImageSource.gallery,
);
img.Image decodedImage = img.decodeImage(file.readAsBytesSync());
print("decodedImage.exif.orientation ${decodedImage.exif.orientation}"); // null
print("decodedImage.exif.data ${decodedImage.exif.data}"); // {}

我将用于此代码的图像通过Google驱动器发送到我的Mac书中,以查看方向值,这就是我得到的:

enter image description here

我正在使用image_picker插件的最新可用版本。如何在Flutter中检索图像的exif方向值?

flutter dart jpeg exif
1个回答
0
投票

也许exifdart程序包可以帮助您。

© www.soinside.com 2019 - 2024. All rights reserved.