首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将EXIF数据写入JPEG文件

将EXIF数据写入JPEG文件
EN

Stack Overflow用户
提问于 2017-11-14 19:41:43
回答 1查看 1.4K关注 0票数 2

对于R,我找到了一个只读取EXIF数据的机会。

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

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-11-20 18:42:16

感谢所有回应的人。因此,我得到了以下解。

安装ExifTool,我使用Ubuntu:

sudo apt安装libimage-exiftool perl

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

代码语言:javascript
复制
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_exifi,11和latlon_exifi,10 -坐标,latlon_exifi,4 -文件名.

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

代码语言:javascript
复制
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_exifi,4),8])数据和时间:'2017-11-16 22:33:17‘

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47293978

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档