R将EXIF数据写入JPEG文件

标签 r exif

对于 R,我发现有机会只读取 EXIF 数据。

R中是否有可能将EXIF数据写入JPEG文件?

最佳答案

感谢所有回复的人。结果,我得到了以下解决方案。

安装ExifTool , 我使用 Ubuntu 命令:

sudo apt install libimage-exiftool-perl

然后在我的 R 代码中,将 GPS 坐标添加到我使用的图像中:

exiftool_cmd <- paste("exiftool -GPSLongitudeRef=E -GPSLongitude=",latlon_exif[i,11]," -GPSLatitudeRef=N -GPSLatitude=",latlon_exif[i,10]," ","./nodejpg/",latlon_exif[i,4],".jpg",sep='')
system(exiftool_cmd)

其中 latlon_exif[i,11]latlon_exif[i,10] - 坐标,latlon_exif[i,4] - 名称文件。

要向图像添加数据和时间,我使用:

exiftool_cmd <- paste("exiftool -alldates=",shQuote(date_exif[which(date_exif[,4]%in%latlon_exif[i,4]),8])," ","./nodejpg/",latlon_exif[i,4],".jpg",sep='')
system(exiftool_cmd)

其中 shQuote(date_exif[which(date_exif[,4]%in%latlon_exif[i,4]),8]) 数据和时间格式:'2017-11- 16 22:33:17'

关于R将EXIF数据写入JPEG文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47293978/

相关文章:

r - 如何在不聚合记录的情况下将长格式的数据框转换/ reshape 为宽格式?

r - 如何使用 tm 包计算 R 中的可读性

image-processing - 从图像中获取地理标签的开源库?

vb.net - 如何将经度和纬度转换为 GPS Exif 字节数组

sql - 名称为 “.”的表

r - R 中累积和的向量

regex - 列出 R 中不匹配模式的文件

python - 使用Python提取Windows Photo Gallery 2012添加的EXIF标签

javascript - 从图像中检索 EXIF

ffmpeg 提取帧并根据 exif 或 txt 中每个提取帧的创建时间获取时间戳