-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathExifData.R
76 lines (71 loc) · 1.61 KB
/
ExifData.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Extracting EXIF data from a photo
# It should be possible to extract EXIF data with the following package, however I have failed
# http://cran.r-project.org/web/packages/adimpro/adimpro.pdf
# Instead using a hack (via a system call) to grab the output from ExifTool
cat("Individuals Photo Files\n")
for (i in 1:length(individual.photos.file)) {
ExifData <- fromJSON(paste(system(paste("/usr/bin/exiftool -j ",individual.photos.file[i]),intern=T), collapse=""))[[1]]
cat(ExifData$FileName," (", ExifData$FileSize,")\n",sep="")
if (!is.null(ExifData$PrimaryPlatform)) {
cat("Photo Primary Platform: ", ExifData$PrimaryPlatform, "\n", seq="")
}
}
rm(i)
# Some of the fields that may be found
# BitsPerSample
# BlueMatrixColumn
# BlueTRC
# ChromaticAdaptation
# CMMFlags
# ColorComponents
# ColorSpaceData
# Comment
# ConnectionSpaceIlluminant
# DeviceAttributes
# DeviceManufacturer
# DeviceModel
# DeviceModelDesc
# Directory
# EncodingProcess
# ExifToolVersion
# FileModifyDate
# FileName
# FilePermissions
# FileSize
# FileType
# GreenMatrixColumn
# GreenTRC
# ImageHeight
# ImageSize
# ImageWidth
# JFIFVersion
# Luminance
# MeasurementBacking
# MeasurementFlare
# MeasurementGeometry
# MeasurementIlluminant
# MeasurementObserver
# MediaBlackPoint
# MediaWhitePoint
# MIMEType
# PrimaryPlatform
# ProfileClass
# ProfileCMMType
# ProfileConnectionSpace
# ProfileCopyright
# ProfileCreator
# ProfileDateTime
# ProfileDescription
# ProfileFileSignature
# ProfileID
# ProfileVersion
# RedMatrixColumn
# RedTRC
# RenderingIntent
# ResolutionUnit
# SourceFile
# Technology
# ViewingCondDesc
# XResolution
# YCbCrSubSampling
# YResolution