R将EXIF数据写入JPEG文件 [英] R write EXIF data to JPEG file
问题描述
对于R,我找到了仅读取EXIF数据的机会.
For R I found an opportunity to only read the EXIF data.
R中是否有可能将EXIF数据写入JPEG文件?
Is there any possibility in R to write EXIF data to JPEG file?
推荐答案
感谢所有答复.结果,我获得了以下解决方案.
Thanks to all who responded. As a result, I obtained the following solution.
安装 ExifTool ,我使用Ubuntu命令:
Install ExifTool, I use Ubuntu comand:
sudo apt install libimage-exiftool-perl
然后在我的R代码中,将GPS坐标添加到我使用的图像中:
Then in my R code, to add GPS coordinates to image I use:
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] -名称文件.
Where latlon_exif[i,11] and latlon_exif[i,10] - coordinates, latlon_exif[i,4] - name of file.
我要为图像添加数据和时间:
To add data and time to image I use:
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'
Where shQuote(date_exif[which(date_exif[,4]%in%latlon_exif[i,4]),8]) data and time in format: '2017-11-16 22:33:17'
这篇关于R将EXIF数据写入JPEG文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!