-
Notifications
You must be signed in to change notification settings - Fork 9
/
iphoto2xmp_template.xmp.erb
173 lines (164 loc) · 5.03 KB
/
iphoto2xmp_template.xmp.erb
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 4.4.0-Exiv2">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:xmp="http://ns.adobe.com/xap/1.0/"
xmlns:acdsee="http://ns.acdsee.com/iptc/1.0/"
xmlns:digiKam="http://www.digikam.org/ns/1.0/"
xmlns:tiff="http://ns.adobe.com/tiff/1.0/"
xmlns:exif="http://ns.adobe.com/exif/1.0/"
xmlns:video="http://www.video/"
xmlns:MicrosoftPhoto="http://ns.microsoft.com/photo/1.0/"
xmlns:mwg-rs="http://www.metadataworkinggroup.com/schemas/regions/"
xmlns:stArea="http://ns.adobe.com/xmp/sType/Area#"
xmlns:MP="http://ns.microsoft.com/photo/1.2/"
xmlns:MPRI="http://ns.microsoft.com/photo/1.2/t/RegionInfo#"
xmlns:MPReg="http://ns.microsoft.com/photo/1.2/t/Region#"
xmlns:lr="http://ns.adobe.com/lightroom/1.0/"
xmlns:mediapro="http://ns.iview-multimedia.com/mediapro/1.0/"
xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:Iptc4xmpCore="http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/"
xmp:CreatorTool="iphoto2xmp.rb by Jens Benecke"
xmp:MetadataDate="<%= @date_meta %>"
xmp:Rating="<%= @rating %>"
xmp:CreateDate="<%= @date_taken %>"
photoshop:DateCreated="<%= @date_taken %>"
acdsee:rating="<%= @rating %>"
<% if !!@caption %>
acdsee:caption="<%= @caption.gsub(/"/, "'") %>"
<% end %>
<% if !!@description %>
acdsee:notes="<%= @description.gsub(/"/, "'") %>"
<% end %>
digiKam:ImageUniqueID="<%= @uuid %>"
digiKam:PickLabel="<%= @hidden %>"
digiKam:ColorLabel="<%= @flagged %>"
exif:DateTimeOriginal="<%= @date_taken %>"
exif:DateTimeDigitized="<%= @date_imported %>"
exif:ExifVersion="0221"
<% if !!@latitude %>
exif:GPSLatitudeRef="N"
exif:GPSLongitudeRef="E"
exif:GPSAltitudeRef="0"
exif:GPSVersionID="2.0.0.0"
exif:GPSLatitude="<%= @latitude %>"
exif:GPSLongitude="<%= @longitude %>"
exif:GPSMapDatum="WGS-84"
<% end %>
<%# according to MWG guidelines, this is how to store dates. http://www.metadataworkinggroup.org/pdf/mwg_guidance.pdf#page=37 %>
<% if !!@date_modified and @date_taken != @date_modified %>
exif:DateTime="<%= @date_modified %>"
xmp:ModifyDate="<%= @date_modified %>"
video:ModificationDate="<%= @date_modified %>"
<% end %>
video:DateTimeOriginal="<%= @date_taken %>"
<% if !!@gpscity %>
photoshop:City="<%= @gpscity %>"
<% end %>
<% if !!@gpsstate %>
photoshop:State="<%= @gpsstate %>"
<% end %>
<% if !!@gpscountryname %>
photoshop:Country="<%= @gpscountryname %>"
<% end %>
<% if !!@gpslocation %>
Iptc4xmpCore:Location="<%= @gpslocation %>"
<% end %>
<% if !!@gps3lettercountrycode %>
Iptc4xmpCore:CountryCode="<%= @gps3lettercountrycode %>"
<% end %>
>
<% if @caption %>
<dc:title>
<rdf:Alt>
<rdf:li xml:lang="x-default"><%= @caption %></rdf:li>
</rdf:Alt>
</dc:title>
<% end %>
<% unless @keylist.empty? %>
<digiKam:TagsList>
<rdf:Seq>
<% for keyword in @keylist %>
<rdf:li><%= keyword %></rdf:li>
<% end %>
</rdf:Seq>
</digiKam:TagsList>
<MicrosoftPhoto:LastKeywordXMP>
<rdf:Bag>
<% for keyword in @keylist %>
<rdf:li><%= keyword %></rdf:li>
<% end %>
</rdf:Bag>
</MicrosoftPhoto:LastKeywordXMP>
<lr:hierarchicalSubject>
<rdf:Bag>
<% for keyword in @keylist %>
<rdf:li><%= keyword %></rdf:li>
<% end %>
</rdf:Bag>
</lr:hierarchicalSubject>
<mediapro:CatalogSets>
<rdf:Bag>
<% for keyword in @keylist %>
<rdf:li><%= keyword %></rdf:li>
<% end %>
</rdf:Bag>
</mediapro:CatalogSets>
<dc:subject>
<rdf:Bag>
<% for keyword in @keylist %>
<rdf:li><%= keyword %></rdf:li>
<% end %>
</rdf:Bag>
</dc:subject>
<% end %>
<% if @description %>
<tiff:ImageDescription>
<rdf:Alt>
<rdf:li xml:lang="x-default"><%= @description %></rdf:li>
</rdf:Alt>
</tiff:ImageDescription>
<exif:UserComment>
<rdf:Alt>
<rdf:li xml:lang="x-default"><%= @description %></rdf:li>
</rdf:Alt>
</exif:UserComment>
<dc:description>
<rdf:Alt>
<rdf:li xml:lang="x-default"><%= @description %></rdf:li>
</rdf:Alt>
</dc:description>
<% end %>
<% if @faces.is_a?(Array) and [email protected]? %>
<!-- <%= @facecomment %> -->
<mwg-rs:Regions rdf:parseType="Resource">
<mwg-rs:RegionList>
<rdf:Bag>
<% for face in @faces %>
<rdf:li>
<rdf:Description
mwg-rs:Name="<%= face['name'] %>"
mwg-rs:Type="Face">
<mwg-rs:Area
stArea:x="<%= face['centerx'] %>"
stArea:y="<%= face['centery'] %>"
stArea:w="<%= face['width'] %>"
stArea:h="<%= face['height'] %>"
stArea:unit="normalized"/>
</rdf:Description>
</rdf:li>
<% end %>
</rdf:Bag>
</mwg-rs:RegionList>
</mwg-rs:Regions>
<% end %>
<dc:creator>
<rdf:Seq>
<rdf:li><%= @creator %></rdf:li>
</rdf:Seq>
</dc:creator>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
<?xpacket end="w"?>