How to add GPS metadata to TIFF in Java?

故事扮演 提交于 2019-12-05 20:34:28

The problem is most likely that the metadata tree representation you are manipulating, is only a working copy. When you later write an image and pass it metadata, your changes to the tree representation are lost.

After you are done updating the metadata tree (root) with your GPS specific tags, you have to either call metadata.setFromTree(TIFF_METADATA_FORMAT, root) or metadata.mergeTree(TIFF_METADATA_FORMAT, root) to set/merge your changes back to the metadata instance. As you start out with metadata.getAsTree(..) rather than an empty structure, you probably want to use setFromTree(..).

PS: If this is not the problem, please add the code where you update your metadata and write the image. :-)

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