Index: branches/img_metadata/phase3/maintenance/language/messages.inc |
— | — | @@ -2720,6 +2720,11 @@ |
2721 | 2721 | 'exif-writer', |
2722 | 2722 | 'exif-languagecode', |
2723 | 2723 | 'exif-iimversion', |
| 2724 | + 'exif-iimcategory', |
| 2725 | + 'exif-iimsupplementalcategory', |
| 2726 | + 'exif-datetimeexpires', |
| 2727 | + 'exif-datetimereleased', |
| 2728 | + 'exif-originaltransmissionref', |
2724 | 2729 | ), |
2725 | 2730 | 'exif-values' => array( |
2726 | 2731 | 'exif-make-value', |
Index: branches/img_metadata/phase3/maintenance/language/messageTypes.inc |
— | — | @@ -632,4 +632,9 @@ |
633 | 633 | 'exif-writer', |
634 | 634 | 'exif-languagecode', |
635 | 635 | 'exif-iimversion', |
| 636 | + 'exif-iimcategory', |
| 637 | + 'exif-iimsupplementalcategory', |
| 638 | + 'exif-datetimeexpires', |
| 639 | + 'exif-datetimereleased', |
| 640 | + 'exif-originaltransmissionref', |
636 | 641 | ); |
Index: branches/img_metadata/phase3/includes/Exif.php |
— | — | @@ -969,6 +969,8 @@ |
970 | 970 | case 'DateTime': |
971 | 971 | case 'DateTimeOriginal': |
972 | 972 | case 'DateTimeDigitized': |
| 973 | + case 'DateTimeReleased': |
| 974 | + case 'DateTimeExpires': |
973 | 975 | case 'GPSDateStamp': |
974 | 976 | if ( $val == '0000:00:00 00:00:00' || $val == ' : : : : ' ) { |
975 | 977 | $val = wfMsg( 'exif-unknowndate' ); |
— | — | @@ -1368,6 +1370,9 @@ |
1369 | 1371 | case 'Contact': |
1370 | 1372 | case 'Writer': |
1371 | 1373 | case 'JPEGFileComment': |
| 1374 | + case 'iimCategory': |
| 1375 | + case 'iimSupplementalCategory': |
| 1376 | + case 'OriginalTransmissionRef': |
1372 | 1377 | |
1373 | 1378 | $val = htmlspecialchars( $val ); |
1374 | 1379 | break; |
Index: branches/img_metadata/phase3/includes/media/IPTC.php |
— | — | @@ -51,8 +51,28 @@ |
52 | 52 | $data['Copyright'] = self::convIPTC( $val, $c ); |
53 | 53 | break; |
54 | 54 | case '2#080': /* byline. Mapped with exif Artist */ |
55 | | - /* TODO: figure out how to handle byline title (2:85) */ |
56 | | - $data['Artist'] = self::convIPTC( $val, $c ); |
| 55 | + /* merge with byline title (2:85) |
| 56 | + * like how exif does it with |
| 57 | + * Title, person. Not sure if this is best |
| 58 | + * approach since we no longer have the two fields |
| 59 | + * seperate. each byline title entry corresponds to a |
| 60 | + * specific byline. */ |
| 61 | + |
| 62 | + $bylines = self::convIPTC( $val, $c ); |
| 63 | + if ( isset( $parsed['2#085'] ) ) { |
| 64 | + $titles = self::convIPTC( $parsed['2#085'], $c ); |
| 65 | + } else { |
| 66 | + $titles = array(); |
| 67 | + } |
| 68 | + |
| 69 | + for ( $i = 0; $i < count( $titles ); $i++ ) { |
| 70 | + if ( isset( $bylines[$i] ) ) { |
| 71 | + // theoretically this should always be set |
| 72 | + // but doesn't hurt to be careful. |
| 73 | + $bylines[$i] = $titles[$i] . ', ' . $bylines[$i]; |
| 74 | + } |
| 75 | + } |
| 76 | + $data['Artist'] = $bylines; |
57 | 77 | break; |
58 | 78 | case '2#025': /* keywords */ |
59 | 79 | $data['Keywords'] = self::convIPTC( $val, $c ); |
— | — | @@ -89,9 +109,16 @@ |
90 | 110 | *an individual." */ |
91 | 111 | $data['Source'] = self::convIPTC( $val, $c ); |
92 | 112 | break; |
| 113 | + |
93 | 114 | case '2#007': /* edit status (lead, correction, etc) */ |
94 | 115 | $data['EditStatus'] = self::convIPTC( $val, $c ); |
95 | 116 | break; |
| 117 | + case '2#015': /* category. deprected. max 3 letters in theory, often more */ |
| 118 | + $data['iimCategory'] = self::convIPTC( $val, $c ); |
| 119 | + break; |
| 120 | + case '2#020': /* category. deprected. */ |
| 121 | + $data['iimSupplementalCategory'] = self::convIPTC( $val, $c ); |
| 122 | + break; |
96 | 123 | case '2#010': /*urgency (1-8. 1 most, 5 normal, 8 low priority)*/ |
97 | 124 | $data['Urgency'] = self::convIPTC( $val, $c ); |
98 | 125 | break; |
— | — | @@ -149,6 +176,13 @@ |
150 | 177 | */ |
151 | 178 | $data['CountryDestCode'] = self::convIPTC( $val, $c ); |
152 | 179 | break; |
| 180 | + case '2#103': |
| 181 | + /* original transmission ref. |
| 182 | + * "A code representing the location of original transmission ac- |
| 183 | + * cording to practices of the provider." |
| 184 | + */ |
| 185 | + $data['OriginalTransmissionRef'] = self::convIPTC( $val, $c ); |
| 186 | + break; |
153 | 187 | case '2#118': /*contact*/ |
154 | 188 | $data['Contact'] = self::convIPTC( $val, $c ); |
155 | 189 | break; |
— | — | @@ -195,7 +229,32 @@ |
196 | 230 | } |
197 | 231 | break; |
198 | 232 | |
| 233 | + case '2#030': |
| 234 | + //Date released. |
| 235 | + if ( isset( $parsed['2#035'] ) ) { |
| 236 | + $time = $parsed['2#035']; |
| 237 | + } else { |
| 238 | + $time = Array(); |
| 239 | + } |
| 240 | + $timestamp = self::timeHelper( $val, $time, $c ); |
| 241 | + if ($timestamp) { |
| 242 | + $data['DateTimeReleased'] = $timestamp; |
| 243 | + } |
| 244 | + break; |
199 | 245 | |
| 246 | + case '2#037': |
| 247 | + //Date expires. |
| 248 | + if ( isset( $parsed['2#038'] ) ) { |
| 249 | + $time = $parsed['2#038']; |
| 250 | + } else { |
| 251 | + $time = Array(); |
| 252 | + } |
| 253 | + $timestamp = self::timeHelper( $val, $time, $c ); |
| 254 | + if ($timestamp) { |
| 255 | + $data['DateTimeExpires'] = $timestamp; |
| 256 | + } |
| 257 | + break; |
| 258 | + |
200 | 259 | case '2#000': /* iim version */ |
201 | 260 | // unlike other tags, this is a 2-byte binary number. |
202 | 261 | //technically this is required if there is iptc data |
— | — | @@ -209,10 +268,7 @@ |
210 | 269 | break; |
211 | 270 | |
212 | 271 | |
213 | | - // TODO: the date related tags |
214 | | - // does not do 2:103. Unsure if there is useful data there. |
215 | | - // TODO: 2:15, 2:20 |
216 | | - // other things not currently done, and not sure if should: |
| 272 | + // Things not currently done, and not sure if should: |
217 | 273 | // 2:12 |
218 | 274 | // purposely does not do 2:125, 2:130, 2:131, |
219 | 275 | // 2:47, 2:50, 2:45, 2:42, 2:8, 2:4, 2:3 |
Index: branches/img_metadata/phase3/languages/messages/MessagesEn.php |
— | — | @@ -3786,6 +3786,11 @@ |
3787 | 3787 | 'exif-writer' => 'Writer', |
3788 | 3788 | 'exif-languagecode' => 'Language', |
3789 | 3789 | 'exif-iimversion' => 'IIM version', |
| 3790 | +'exif-iimcategory' => 'Category', |
| 3791 | +'exif-iimsupplementalcategory' => 'Supplemental categories', |
| 3792 | +'exif-datetimeexpires' => 'Do not use after', |
| 3793 | +'exif-datetimereleased' => 'Released on', |
| 3794 | +'exif-originaltransmissionref' => 'Original transmission location code', |
3790 | 3795 | |
3791 | 3796 | # Make & model, can be wikified in order to link to the camera and model name |
3792 | 3797 | 'exif-make-value' => '$1', # do not translate or duplicate this message to other languages |