Copy all EXIF information from one jpg to another jpg in R.

huangapple go评论54阅读模式
英文:

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")

huangapple
  • 本文由 发表于 2023年2月10日 02:58:52
  • 转载请务必保留本文链接:https://go.coder-hub.com/75403237.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定