public void saveAttributes()
Added in API level 5
Save the tag data into the JPEG file. This is expensive because it involves copying all the JPG data from one file to another and deleting the old file and renaming the other. It's best to use setAttribute(String, String) to set all attributes to write and make a single call rather than multiple calls for each attribute.
Throws
IOException
它清楚地说,这是复制ALL的数据,包括你说是消失了的东西。你可能会发布你正在测试的东西吗?如果你在Android Studio上,你可以尝试File - > Invalidate Caches/Restart - > Invalidate and Restart。
正如其他人所指出的,你必须从 原始图像复制的EXIF数据到最终调整图像。桑塞兰的Android 库通常最适合这一点。根据Android操作系统版本, ExifInterface有时会破坏EXIF数据。此外,ExifInterface还处理有限数量的Exif标签 - 即仅“知道”标签的 。另一方面Sanselan将 保留所有EXIF标记和标记笔记。 这是一篇博客文章,展示如何使用Sanselan复制图像数据: http://bricolsoftconsulting.com/copying-exif-metadata-using-sanselan/ 顺便说一句,在Android上我也倾向于旋转图像并删除Orientation EXIF标签。例如,在搭载Android 4.03的Nexus S上, 相机在EXIF元数据中设置了方向标签,但是网页视图忽略了该信息并且错误地显示了图像。 不幸的是,旋转实际图像数据并删除方向标记是唯一的方法,让每个程序正确显示图像 。
我希望这会有所帮助。