英文:
Copy all EXIF information from one jpg to another jpg in R
问题
我将一张jpg图像读入R,以及其所有的EXIF元数据。
然后我对图像进行一些处理,并将输出写成jpg。
如何将所有的EXIF信息复制到新的jpg文件中?
(我理解我只需要修改少量标签)。
我找到了有关如何在R中读取EXIF元数据的非常有用的信息
(例如,使用Thermimage或exiftoolr包),但没有关于如何写入它们的信息。
英文:
I read a jpg image into R as well as all of its EXIF metadata.
Then I do some manipulation to the image and write the output as jpg.
How could I copy all EXIF information to the new jpg file?
(I understand I will need to modify only few tags).
I find very useful information on how to read the EXIF metadata in R
(eg, packages Thermimage or exiftoolr), but not on writing them.
答案1
得分: 1
exiftoolr
包允许您调用 exif_call()
来运行底层 exiftool
能够执行的任何命令。示例可以在这里找到:https://exiftool.org/examples.html。因此,如果您想在 R 中运行以下命令,您可以将其翻译为:
exiftoolr::exif_call(args=c(
'-artist="Phil Harvey"',
'-copyright="2011 Phil Harvey"'
),
path="a.jpg")
英文:
The exiftoolr
package allows you to call exif_call()
to run any command that the underlying exiftool
can do. Examples are included here: https://exiftool.org/examples.html. So if you wanted to run the following command in R you would translate
exiftool -artist="Phil Harvey" -copyright="2011 Phil Harvey" a.jpg
into
exiftoolr::exif_call(args=c(
'-artist="Phil Harvey"',
'-copyright="2011 Phil Harvey"'
),
path="a.jpg")
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论