Index: branches/img_metadata/phase3/maintenance/language/messages.inc |
— | — | @@ -2756,12 +2756,14 @@ |
2757 | 2757 | 'exif-disclaimer', |
2758 | 2758 | 'exif-contentwarning', |
2759 | 2759 | 'exif-giffilecomment', |
| 2760 | + 'exif-intellectualgenre', |
2760 | 2761 | ), |
2761 | 2762 | 'exif-values' => array( |
2762 | 2763 | 'exif-make-value', |
2763 | 2764 | 'exif-model-value', |
2764 | 2765 | 'exif-software-value', |
2765 | 2766 | 'exif-software-version-value', |
| 2767 | + 'exif-contact-value', |
2766 | 2768 | ), |
2767 | 2769 | 'exif-compression' => array( |
2768 | 2770 | 'exif-compression-1', |
— | — | @@ -3002,6 +3004,25 @@ |
3003 | 3005 | 'exif-maxaperturevalue' => array( |
3004 | 3006 | 'exif-maxaperturevalue-value', |
3005 | 3007 | ), |
| 3008 | + 'exif-iimcategory' => array( |
| 3009 | + 'exif-iimcategory-ace', |
| 3010 | + 'exif-iimcategory-clj', |
| 3011 | + 'exif-iimcategory-dis', |
| 3012 | + 'exif-iimcategory-fin', |
| 3013 | + 'exif-iimcategory-edu', |
| 3014 | + 'exif-iimcategory-evn', |
| 3015 | + 'exif-iimcategory-hth', |
| 3016 | + 'exif-iimcategory-hum', |
| 3017 | + 'exif-iimcategory-lab', |
| 3018 | + 'exif-iimcategory-lif', |
| 3019 | + 'exif-iimcategory-pol', |
| 3020 | + 'exif-iimcategory-rel', |
| 3021 | + 'exif-iimcategory-sci', |
| 3022 | + 'exif-iimcategory-soi', |
| 3023 | + 'exif-iimcategory-spo', |
| 3024 | + 'exif-iimcategory-war', |
| 3025 | + 'exif-iimcategory-wea', |
| 3026 | + ), |
3006 | 3027 | 'edit-externally' => array( |
3007 | 3028 | 'edit-externally', |
3008 | 3029 | 'edit-externally-help', |
Index: branches/img_metadata/phase3/maintenance/language/messageTypes.inc |
— | — | @@ -266,6 +266,7 @@ |
267 | 267 | 'exif-lightsource-22', |
268 | 268 | 'exif-lightsource-23', |
269 | 269 | 'exif-filesource-3', |
| 270 | + 'exif-contact-value', |
270 | 271 | 'booksources-isbn', |
271 | 272 | 'sp-contributions-explain', |
272 | 273 | 'sorbs', |
— | — | @@ -674,4 +675,22 @@ |
675 | 676 | 'exif-contentwarning', |
676 | 677 | 'exif-giffilecomment', |
677 | 678 | 'exif-maxaperturevalue-value', |
| 679 | + 'exif-intellectualgenre', |
| 680 | + 'exif-iimcategory-ace', |
| 681 | + 'exif-iimcategory-clj', |
| 682 | + 'exif-iimcategory-dis', |
| 683 | + 'exif-iimcategory-fin', |
| 684 | + 'exif-iimcategory-edu', |
| 685 | + 'exif-iimcategory-evn', |
| 686 | + 'exif-iimcategory-hth', |
| 687 | + 'exif-iimcategory-hum', |
| 688 | + 'exif-iimcategory-lab', |
| 689 | + 'exif-iimcategory-lif', |
| 690 | + 'exif-iimcategory-pol', |
| 691 | + 'exif-iimcategory-rel', |
| 692 | + 'exif-iimcategory-sci', |
| 693 | + 'exif-iimcategory-soi', |
| 694 | + 'exif-iimcategory-spo', |
| 695 | + 'exif-iimcategory-war', |
| 696 | + 'exif-iimcategory-wea', |
678 | 697 | ); |
Index: branches/img_metadata/phase3/includes/media/FormatMetadata.php |
— | — | @@ -104,7 +104,14 @@ |
105 | 105 | continue; |
106 | 106 | } |
107 | 107 | |
108 | | - |
| 108 | + // The contact info is a multi-valued field |
| 109 | + // instead of the other props which are single |
| 110 | + // valued (mostly) so handle as a special case. |
| 111 | + if ( $tag === 'Contact' ) { |
| 112 | + $vals = self::collapseContactInfo( $vals ); |
| 113 | + continue; |
| 114 | + } |
| 115 | + |
109 | 116 | foreach ( $vals as &$val ) { |
110 | 117 | |
111 | 118 | switch( $tag ) { |
— | — | @@ -616,8 +623,28 @@ |
617 | 624 | break; |
618 | 625 | |
619 | 626 | |
| 627 | + case 'iimCategory': |
| 628 | + switch( strtolower($val) ) { |
| 629 | + // See pg 29 of IPTC photo |
| 630 | + // metadata standard. |
| 631 | + case 'ace': case 'clj': |
| 632 | + case 'dis': case 'fin': |
| 633 | + case 'edu': case 'evn': |
| 634 | + case 'hth': case 'hum': |
| 635 | + case 'lab': case 'lif': |
| 636 | + case 'pol': case 'rel': |
| 637 | + case 'sci': case 'soi': |
| 638 | + case 'spo': case 'war': |
| 639 | + case 'wea': |
| 640 | + $val = self::msg( |
| 641 | + 'iimcategory', |
| 642 | + $val |
| 643 | + ); |
| 644 | + } |
| 645 | + break; |
620 | 646 | // Do not transform fields with pure text. |
621 | | - // For some languages the formatNum() conversion results to wrong output like |
| 647 | + // For some languages the formatNum() |
| 648 | + // conversion results to wrong output like |
622 | 649 | // foo,bar@example,com or foo٫bar@example٫com |
623 | 650 | case 'ImageDescription': |
624 | 651 | case 'Artist': |
— | — | @@ -644,10 +671,8 @@ |
645 | 672 | case 'FixtureIdentifier': |
646 | 673 | case 'LocationDest': |
647 | 674 | case 'LocationDestCode': |
648 | | - case 'Contact': |
649 | 675 | case 'Writer': |
650 | 676 | case 'JPEGFileComment': |
651 | | - case 'iimCategory': |
652 | 677 | case 'iimSupplementalCategory': |
653 | 678 | case 'OriginalTransmissionRef': |
654 | 679 | case 'Identifier': |
— | — | @@ -740,9 +765,9 @@ |
741 | 766 | * @return String single value (in wiki-syntax). |
742 | 767 | */ |
743 | 768 | public static function flattenArray( $vals, $type = 'ul' ) { |
744 | | - |
745 | 769 | if ( isset( $vals['_type'] ) ) { |
746 | 770 | $type = $vals['_type']; |
| 771 | + unset( $vals['_type'] ); |
747 | 772 | } |
748 | 773 | |
749 | 774 | if ( !is_array( $vals ) ) { |
— | — | @@ -1019,7 +1044,111 @@ |
1020 | 1045 | |
1021 | 1046 | return wfMsg( 'exif-coordinate-format', $deg, $min, $sec, $ref, $coord ); |
1022 | 1047 | } |
| 1048 | + /** |
| 1049 | + * Format the contact info field into a single value. |
| 1050 | + * |
| 1051 | + * @param $vals Array array with fields of the ContactInfo |
| 1052 | + * struct defined in the IPTC4XMP spec. Or potentially |
| 1053 | + * an array with one element that is a free form text |
| 1054 | + * value from the older iptc iim 1:118 prop. |
| 1055 | + * |
| 1056 | + * This function might be called from |
| 1057 | + * JpegHandler::convertMetadataVersion which is why it is |
| 1058 | + * public. |
| 1059 | + * |
| 1060 | + * @return String of html-ish looking wikitext |
| 1061 | + */ |
| 1062 | + public function collapseContactInfo( $vals ) { |
| 1063 | + if( ! ( isset( $vals['CiAdrExtadr'] ) |
| 1064 | + || isset( $vals['CiAdrCity'] ) |
| 1065 | + || isset( $vals['CiAdrCtry'] ) |
| 1066 | + || isset( $vals['CiEmailWork'] ) |
| 1067 | + || isset( $vals['CiTelWork'] ) |
| 1068 | + || isset( $vals['CiAdrPcode'] ) |
| 1069 | + || isset( $vals['CiAdrRegion'] ) |
| 1070 | + || isset( $vals['CiUrlWork'] ) |
| 1071 | + ) ) { |
| 1072 | + // We don't have any sub-properties |
| 1073 | + // This could happen if its using old |
| 1074 | + // iptc that just had this as a free-form |
| 1075 | + // text value. |
| 1076 | + // Note: We run this through htmlspecialchars |
| 1077 | + // partially to be consistent, and partially |
| 1078 | + // because people often insert >, etc into |
| 1079 | + // the metadata which should not be interperted |
| 1080 | + // but we still want to auto-link urls. |
| 1081 | + foreach( $vals as &$val ) { |
| 1082 | + $val = htmlspecialchars( $val ); |
| 1083 | + } |
| 1084 | + return self::flattenArray( $vals ); |
| 1085 | + } else { |
| 1086 | + // We have a real ContactInfo field. |
| 1087 | + // Its unclear if all these fields have to be |
| 1088 | + // set, so assume they do not. |
| 1089 | + $url = $tel = $street = $city = $country = ''; |
| 1090 | + $email = $postal = $region = ''; |
1023 | 1091 | |
| 1092 | + // Also note, some of the class names this uses |
| 1093 | + // are similar to those used by hCard. This is |
| 1094 | + // mostly because they're sensible names. This |
| 1095 | + // does not (and does not attempt to) output |
| 1096 | + // stuff in the hCard microformat. However it |
| 1097 | + // might output in the adr microformat. |
| 1098 | + |
| 1099 | + if ( isset( $vals['CiAdrExtadr'] ) ) { |
| 1100 | + // Todo: This can potentially be multi-line. |
| 1101 | + // Need to check how that works in XMP. |
| 1102 | + $street = '<span class="extended-address">' |
| 1103 | + . htmlspecialchars( |
| 1104 | + $vals['CiAdrExtadr'] ) |
| 1105 | + . '</span>'; |
| 1106 | + } |
| 1107 | + if ( isset( $vals['CiAdrCity'] ) ) { |
| 1108 | + $city = '<span class="locality">' |
| 1109 | + . htmlspecialchars( $vals['CiAdrCity'] ) |
| 1110 | + . '</span>'; |
| 1111 | + } |
| 1112 | + if ( isset( $vals['CiAdrCtry'] ) ) { |
| 1113 | + $country = '<span class="country-name">' |
| 1114 | + . htmlspecialchars( $vals['CiAdrCtry'] ) |
| 1115 | + . '</span>'; |
| 1116 | + } |
| 1117 | + if ( isset( $vals['CiEmailWork'] ) ) { |
| 1118 | + $email = '[mailto:' |
| 1119 | + . rawurlencode( |
| 1120 | + $vals['CiEmailWork'] ) |
| 1121 | + . ' <span class="email">' |
| 1122 | + . $vals['CiEmailWork'] |
| 1123 | + . '</span>]'; |
| 1124 | + } |
| 1125 | + if ( isset( $vals['CiTelWork'] ) ) { |
| 1126 | + $tel = '<span class="tel">' |
| 1127 | + . htmlspecialchars( $vals['CiTelWork'] ) |
| 1128 | + . '</span>'; |
| 1129 | + } |
| 1130 | + if ( isset( $vals['CiAdrPcode'] ) ) { |
| 1131 | + $postal = '<span class="postal-code">' |
| 1132 | + . htmlspecialchars( |
| 1133 | + $vals['CiAdrPcode'] ) |
| 1134 | + . '</span>'; |
| 1135 | + } |
| 1136 | + if ( isset( $vals['CiAdrRegion'] ) ) { |
| 1137 | + // Note this is province/state. |
| 1138 | + $region = '<span class="region">' |
| 1139 | + . htmlspecialchars( |
| 1140 | + $vals['CiAdrRegion'] ) |
| 1141 | + . '</span>'; |
| 1142 | + } |
| 1143 | + if ( isset( $vals['CiUrlWork'] ) ) { |
| 1144 | + $url = '<span class="url">' |
| 1145 | + . htmlspecialchars( $vals['CiUrlWork'] ) |
| 1146 | + . '</span>'; |
| 1147 | + } |
| 1148 | + return wfMsg( 'exif-contact-value', $email, $url, |
| 1149 | + $street, $city, $region, $postal, $country, |
| 1150 | + $tel ); |
| 1151 | + } |
| 1152 | + } |
1024 | 1153 | } |
1025 | 1154 | |
1026 | 1155 | /** For compatability with old FormatExif class |
Index: branches/img_metadata/phase3/includes/media/IPTC.php |
— | — | @@ -267,11 +267,25 @@ |
268 | 268 | } |
269 | 269 | break; |
270 | 270 | |
| 271 | + case '2#004': |
| 272 | + // IntellectualGenere. |
| 273 | + // first 4 characters are an id code |
| 274 | + // That we're not really interested in. |
| 275 | + if ( strlen( $val[0] < 5 ) ) { |
| 276 | + wfDebugLog( 'iptc', 'IPTC: ' |
| 277 | + . '2:04 too short. ' |
| 278 | + . 'Ignoring.' ); |
| 279 | + break; |
| 280 | + } |
| 281 | + $extracted = substr( $val[0], 4 ); |
| 282 | + $data['IntellectualGenre'] = $extracted; |
| 283 | + break; |
271 | 284 | |
| 285 | + |
272 | 286 | // Things not currently done, and not sure if should: |
273 | 287 | // 2:12 |
274 | 288 | // purposely does not do 2:125, 2:130, 2:131, |
275 | | - // 2:47, 2:50, 2:45, 2:42, 2:8, 2:4, 2:3 |
| 289 | + // 2:47, 2:50, 2:45, 2:42, 2:8, 2:3 |
276 | 290 | // 2:200, 2:201, 2:202 |
277 | 291 | // or the audio stuff (2:150 to 2:154) |
278 | 292 | |
— | — | @@ -279,6 +293,8 @@ |
280 | 294 | case '2#060': |
281 | 295 | case '2#063': |
282 | 296 | case '2#085': |
| 297 | + case '2#038': |
| 298 | + case '2#035': |
283 | 299 | //ignore. Handled elsewhere. |
284 | 300 | break; |
285 | 301 | |
Index: branches/img_metadata/phase3/includes/media/XMP.php |
— | — | @@ -58,7 +58,7 @@ |
59 | 59 | const MODE_STRUCT = 11; // structure (associative array) |
60 | 60 | const MODE_SEQ = 12; // orderd list |
61 | 61 | const MODE_BAG = 13; // unordered list |
62 | | - const MODE_LANG = 14; // lang alt. TODO: implement |
| 62 | + const MODE_LANG = 14; |
63 | 63 | const MODE_ALT = 15; // non-language alt. Currently not implemented, and not needed atm. |
64 | 64 | |
65 | 65 | const NS_RDF = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'; |
— | — | @@ -123,7 +123,27 @@ |
124 | 124 | public function getResults() { |
125 | 125 | // xmp-special is for metadata that affects how stuff |
126 | 126 | // is extracted. For example xmpNote:HasExtendedXMP. |
| 127 | + |
| 128 | + // It is also used to handle photoshop:AuthorsPosition |
| 129 | + // which is weird and really part of another property, |
| 130 | + // see 2:85 in IPTC. See also pg 21 of IPTC4XMP standard. |
| 131 | + |
127 | 132 | $data = $this->results; |
| 133 | + |
| 134 | + if ( isset( $data['xmp-special']['AuthorsPosition'] ) |
| 135 | + && is_string( $data['xmp-special']['AuthorsPosition'] ) |
| 136 | + && isset( $data['xmp-general']['Artist'][0] ) |
| 137 | + ) { |
| 138 | + // Note, if there is more than one creator, |
| 139 | + // this only applies to first. This also will |
| 140 | + // only apply to the dc:Creator prop, not the |
| 141 | + // exif:Artist prop. |
| 142 | + |
| 143 | + $data['xmp-general']['Artist'][0] = |
| 144 | + $data['xmp-special']['AuthorsPosition'] . ', ' |
| 145 | + . $data['xmp-general']['Artist'][0]; |
| 146 | + } |
| 147 | + |
128 | 148 | unset( $data['xmp-special'] ); |
129 | 149 | |
130 | 150 | // Convert GPSAltitude to negative if below sea level. |
— | — | @@ -603,7 +623,7 @@ |
604 | 624 | |
605 | 625 | } else { |
606 | 626 | // something else we don't recognize, like a qualifier maybe. |
607 | | - wfDebugLog( 'XMP', __METHOD__ . " Encoutered element <$elm> where only expecting character data." ); |
| 627 | + wfDebugLog( 'XMP', __METHOD__ . " Encoutered element <$elm> where only expecting character data as value of " . $this->curItem[0] ); |
608 | 628 | array_unshift( $this->mode, self::MODE_IGNORE ); |
609 | 629 | array_unshift( $this->curItem, $elm ); |
610 | 630 | |
— | — | @@ -640,6 +660,19 @@ |
641 | 661 | if ( $ns !== self::NS_RDF ) { |
642 | 662 | |
643 | 663 | if ( isset( $this->items[$ns][$tag] ) ) { |
| 664 | + if ( isset( $this->items[$ns][$tag]['structPart'] ) ) { |
| 665 | + // If this element is supposed to appear only as |
| 666 | + // a child of a structure, but appears here (not as |
| 667 | + // a child of a struct), then something weird is |
| 668 | + // happening, so ignore this element and its children. |
| 669 | + |
| 670 | + wfDebugLog( 'XMP', "Encoutered <$ns:$tag> outside" |
| 671 | + . " of its expected parent. Ignoring." ); |
| 672 | + |
| 673 | + array_unshift( $this->mode, self::MODE_IGNORE ); |
| 674 | + array_unshift( $this->curItem, $ns . ' ' . $tag ); |
| 675 | + return; |
| 676 | + } |
644 | 677 | $mode = $this->items[$ns][$tag]['mode']; |
645 | 678 | array_unshift( $this->mode, $mode ); |
646 | 679 | array_unshift( $this->curItem, $ns . ' ' . $tag ); |
— | — | @@ -653,6 +686,7 @@ |
654 | 687 | throw new MWException( 'tag nested in non-whitespace characters.' ); |
655 | 688 | } |
656 | 689 | } else { |
| 690 | + // This element is not on our list of allowed elements so ignore. |
657 | 691 | array_unshift( $this->mode, self::MODE_IGNORE ); |
658 | 692 | array_unshift( $this->curItem, $ns . ' ' . $tag ); |
659 | 693 | return; |
Index: branches/img_metadata/phase3/includes/media/XMPInfo.php |
— | — | @@ -29,6 +29,7 @@ |
30 | 30 | * * choices - array of potential values (format of 'value' => true ). Only used with validateClosed |
31 | 31 | * * rangeLow and rangeHigh - alternative to choices for numeric ranges. Again for validateClosed only. |
32 | 32 | * * children - for MODE_STRUCT items, allowed children. |
| 33 | + * * structPart - Indicates that this element can only appear as a memeber of a structure. |
33 | 34 | * |
34 | 35 | * currently this just has a bunch of exif values as this class is only half-done |
35 | 36 | */ |
— | — | @@ -73,7 +74,7 @@ |
74 | 75 | 'FlashEnergy' => array( |
75 | 76 | 'map_group' => 'exif', |
76 | 77 | 'mode' => XMPReader::MODE_SIMPLE, |
77 | | - 'validate' => 'validateRational' |
| 78 | + 'validate' => 'validateRational', |
78 | 79 | ), |
79 | 80 | 'FNumber' => array( |
80 | 81 | 'map_group' => 'exif', |
— | — | @@ -161,12 +162,14 @@ |
162 | 163 | 'Fired' => array( |
163 | 164 | 'map_group' => 'exif', |
164 | 165 | 'validate' => 'validateBoolean', |
165 | | - 'mode' => XMPReader::MODE_SIMPLE |
| 166 | + 'mode' => XMPReader::MODE_SIMPLE, |
| 167 | + 'structPart'=> true, |
166 | 168 | ), |
167 | 169 | 'Function' => array( |
168 | 170 | 'map_group' => 'exif', |
169 | 171 | 'validate' => 'validateBoolean', |
170 | 172 | 'mode' => XMPReader::MODE_SIMPLE, |
| 173 | + 'structPart'=> true, |
171 | 174 | ), |
172 | 175 | 'Mode' => array( |
173 | 176 | 'map_group' => 'exif', |
— | — | @@ -174,6 +177,7 @@ |
175 | 178 | 'mode' => XMPReader::MODE_SIMPLE, |
176 | 179 | 'choices' => array( '0' => true, '1' => true, |
177 | 180 | '2' => true, '3' => true ), |
| 181 | + 'structPart'=> true, |
178 | 182 | ), |
179 | 183 | 'Return' => array( |
180 | 184 | 'map_group' => 'exif', |
— | — | @@ -181,11 +185,13 @@ |
182 | 186 | 'mode' => XMPReader::MODE_SIMPLE, |
183 | 187 | 'choices' => array( '0' => true, |
184 | 188 | '2' => true, '3' => true ), |
| 189 | + 'structPart'=> true, |
185 | 190 | ), |
186 | 191 | 'RedEyeMode' => array( |
187 | 192 | 'map_group' => 'exif', |
188 | 193 | 'validate' => 'validateBoolean', |
189 | 194 | 'mode' => XMPReader::MODE_SIMPLE, |
| 195 | + 'structPart'=> true, |
190 | 196 | ), |
191 | 197 | /* End Flash */ |
192 | 198 | 'ISOSpeedRatings' => array( |
— | — | @@ -647,7 +653,7 @@ |
648 | 654 | ), |
649 | 655 | 'rights' => array( |
650 | 656 | 'map_group' => 'general', |
651 | | - 'map_name' => 'dc-rights', |
| 657 | + 'map_name' => 'Copyright', |
652 | 658 | 'mode' => XMPReader::MODE_LANG, |
653 | 659 | ), |
654 | 660 | // Note: source is not mapped with iptc source, since iptc |
— | — | @@ -781,8 +787,164 @@ |
782 | 788 | 'http://ns.adobe.com/xmp/note/' => array( |
783 | 789 | 'HasExtendedXMP' => array( |
784 | 790 | 'map_group' => 'special', |
785 | | - 'mode' => XMPReader::MODE_SIMPLE, |
| 791 | + 'mode' => XMPReader::MODE_SIMPLE, |
786 | 792 | ), |
787 | 793 | ), |
| 794 | + /* Note, in iptc schemas, the legacy properties are denoted |
| 795 | + * as deprected, since other properties should used instead, |
| 796 | + * and properties marked as deprected in the standard are |
| 797 | + * are marked as general here as they don't have replacements |
| 798 | + */ |
| 799 | + 'http://ns.adobe.com/photoshop/1.0/' => array( |
| 800 | + 'City' => array( |
| 801 | + 'map_group' => 'deprected', |
| 802 | + 'mode' => XMPReader::MODE_SIMPLE, |
| 803 | + 'map_name' => 'CityDest', |
| 804 | + ), |
| 805 | + 'Country' => array( |
| 806 | + 'map_group' => 'deprected', |
| 807 | + 'mode' => XMPReader::MODE_SIMPLE, |
| 808 | + 'map_name' => 'CountryDest', |
| 809 | + ), |
| 810 | + 'State' => array( |
| 811 | + 'map_group' => 'deprected', |
| 812 | + 'mode' => XMPReader::MODE_SIMPLE, |
| 813 | + 'map_name' => 'ProvinceOrStateDest', |
| 814 | + ), |
| 815 | + 'DateCreated' => array( |
| 816 | + 'map_group' => 'deprected', |
| 817 | + // marking as deprected as the xmp prop prefered |
| 818 | + 'mode' => XMPReader::MODE_SIMPLE, |
| 819 | + 'map_name' => 'DateTimeOriginal', |
| 820 | + 'validate' => 'validateDate', |
| 821 | + // note this prop is an XMP, not IPTC date |
| 822 | + ), |
| 823 | + 'CaptionWriter' => array( |
| 824 | + 'map_group' => 'general', |
| 825 | + 'mode' => XMPReader::MODE_SIMPLE, |
| 826 | + 'map_name' => 'Writer', |
| 827 | + ), |
| 828 | + 'Instructions' => array( |
| 829 | + 'map_group' => 'general', |
| 830 | + 'mode' => XMPReader::MODE_SIMPLE, |
| 831 | + 'map_name' => 'SpecialInstructions', |
| 832 | + ), |
| 833 | + 'TransmissionReference' => array( |
| 834 | + 'map_group' => 'general', |
| 835 | + 'mode' => XMPReader::MODE_SIMPLE, |
| 836 | + 'map_name' => 'OriginalTransmissionRef', |
| 837 | + ), |
| 838 | + 'AuthorsPosition' => array( |
| 839 | + /* This corresponds with 2:85 |
| 840 | + * By-line Title, which needs to be |
| 841 | + * handled weirdly to correspond |
| 842 | + * with iptc/exif. */ |
| 843 | + 'map_group' => 'special', |
| 844 | + 'mode' => XMPReader::MODE_SIMPLE |
| 845 | + ), |
| 846 | + 'Credit' => array( |
| 847 | + 'map_group' => 'general', |
| 848 | + 'mode' => XMPReader::MODE_SIMPLE, |
| 849 | + ), |
| 850 | + 'Source' => array( |
| 851 | + 'map_group' => 'general', |
| 852 | + 'mode' => XMPReader::MODE_SIMPLE, |
| 853 | + ), |
| 854 | + 'Urgency' => array( |
| 855 | + 'map_group' => 'general', |
| 856 | + 'mode' => XMPReader::MODE_SIMPLE, |
| 857 | + ), |
| 858 | + 'Category' => array( |
| 859 | + // Note, this prop is deprected, but in general |
| 860 | + // group since it doesn't have a replacement. |
| 861 | + 'map_group' => 'general', |
| 862 | + 'mode' => XMPReader::MODE_SIMPLE, |
| 863 | + 'map_name' => 'iimCategory', |
| 864 | + ), |
| 865 | + 'SupplementalCategories' => array( |
| 866 | + 'map_group' => 'general', |
| 867 | + 'mode' => XMPReader::MODE_BAG, |
| 868 | + 'map_name' => 'iimSupplementalCategory', |
| 869 | + ), |
| 870 | + ), |
| 871 | + 'http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/' => array( |
| 872 | + 'CountryCode' => array( |
| 873 | + 'map_group' => 'deprected', |
| 874 | + 'mode' => XMPReader::MODE_SIMPLE, |
| 875 | + 'map_name' => 'CountryDestCode', |
| 876 | + ), |
| 877 | + 'IntellectualGenre' => array( |
| 878 | + 'map_group' => 'general', |
| 879 | + 'mode' => XMPReader::MODE_SIMPLE, |
| 880 | + ), |
| 881 | + /* Note: Scene not done. */ |
| 882 | + /* Note: SubjectCode (iim 2:12) not done. */ |
| 883 | + 'Location' => array( |
| 884 | + 'map_group' => 'deprected', |
| 885 | + 'mode' => XMPReader::MODE_SIMPLE, |
| 886 | + 'map_name' => 'SublocationDest', |
| 887 | + ), |
| 888 | + 'CreatorContactInfo' => array( |
| 889 | + /* Note this maps to 2:118 in iim |
| 890 | + * (Contact) field. However those field |
| 891 | + * types are slightly different - 2:118 |
| 892 | + * is free form text field, where this |
| 893 | + * is more structured. |
| 894 | + */ |
| 895 | + 'map_group' => 'general', |
| 896 | + 'mode' => XMPReader::MODE_STRUCT, |
| 897 | + 'map_name' => 'Contact', |
| 898 | + 'children' => array( |
| 899 | + 'CiAdrExtadr' => true, |
| 900 | + 'CiAdrCity' => true, |
| 901 | + 'CiAdrCtry' => true, |
| 902 | + 'CiEmailWork' => true, |
| 903 | + 'CiTelWork' => true, |
| 904 | + 'CiAdrPcode' => true, |
| 905 | + 'CiAdrRegion' => true, |
| 906 | + 'CiUrlWork' => true, |
| 907 | + ), |
| 908 | + ), |
| 909 | + 'CiAdrExtadr' => array( /* address */ |
| 910 | + 'map_group' => 'general', |
| 911 | + 'mode' => XMPReader::MODE_SIMPLE, |
| 912 | + 'structPart'=> true, |
| 913 | + ), |
| 914 | + 'CiAdrCity' => array( /* city */ |
| 915 | + 'map_group' => 'general', |
| 916 | + 'mode' => XMPReader::MODE_SIMPLE, |
| 917 | + 'structPart'=> true, |
| 918 | + ), |
| 919 | + 'CiAdrCtry' => array( /* country */ |
| 920 | + 'map_group' => 'general', |
| 921 | + 'mode' => XMPReader::MODE_SIMPLE, |
| 922 | + 'structPart'=> true, |
| 923 | + ), |
| 924 | + 'CiEmailWork' => array( /* email (possibly seperated by ',') */ |
| 925 | + 'map_group' => 'general', |
| 926 | + 'mode' => XMPReader::MODE_SIMPLE, |
| 927 | + 'structPart'=> true, |
| 928 | + ), |
| 929 | + 'CiTelWork' => array( /* telephone */ |
| 930 | + 'map_group' => 'general', |
| 931 | + 'mode' => XMPReader::MODE_SIMPLE, |
| 932 | + 'structPart'=> true, |
| 933 | + ), |
| 934 | + 'CiAdrPcode' => array( /* postal code */ |
| 935 | + 'map_group' => 'general', |
| 936 | + 'mode' => XMPReader::MODE_SIMPLE, |
| 937 | + 'structPart'=> true, |
| 938 | + ), |
| 939 | + 'CiAdrRegion' => array( /* province/state */ |
| 940 | + 'map_group' => 'general', |
| 941 | + 'mode' => XMPReader::MODE_SIMPLE, |
| 942 | + 'structPart'=> true, |
| 943 | + ), |
| 944 | + 'CiUrlWork' => array( /* url. Multiple may be seperated by comma. */ |
| 945 | + 'map_group' => 'general', |
| 946 | + 'mode' => XMPReader::MODE_SIMPLE, |
| 947 | + 'structPart'=> true, |
| 948 | + ), |
| 949 | + ), |
788 | 950 | ); |
789 | 951 | } |
Index: branches/img_metadata/phase3/includes/media/Jpeg.php |
— | — | @@ -67,6 +67,13 @@ |
68 | 68 | . $metadata['Software'][0][1] . ')'; |
69 | 69 | } |
70 | 70 | |
| 71 | + // ContactInfo also has to be dealt with specially |
| 72 | + if ( isset( $metadata['Contact'] ) ) { |
| 73 | + $metadata['Contact'] = |
| 74 | + FormatMetadata::collapseContactInfo( |
| 75 | + $metadata['Contact'] ); |
| 76 | + } |
| 77 | + |
71 | 78 | foreach ( $metadata as &$val ) { |
72 | 79 | if ( is_array( $val ) ) { |
73 | 80 | $val = FormatMetadata::flattenArray( $val ); |
Index: branches/img_metadata/phase3/languages/messages/MessagesEn.php |
— | — | @@ -3825,6 +3825,7 @@ |
3826 | 3826 | 'exif-disclaimer' => 'Disclaimer', |
3827 | 3827 | 'exif-contentwarning' => 'Content warning', |
3828 | 3828 | 'exif-giffilecomment' => 'GIF file comment', |
| 3829 | +'exif-intellectualgenre' => 'Type of item', |
3829 | 3830 | |
3830 | 3831 | |
3831 | 3832 | # Make & model, can be wikified in order to link to the camera and model name |
— | — | @@ -4041,6 +4042,34 @@ |
4042 | 4043 | |
4043 | 4044 | 'exif-maxaperturevalue-value' => '$1 APEX (f/$2)', |
4044 | 4045 | |
| 4046 | +'exif-contact-value' => '$1 |
| 4047 | + |
| 4048 | +$2 |
| 4049 | +<div class="adr"> |
| 4050 | +$3 |
| 4051 | + |
| 4052 | +$4, $5, $6 $7 |
| 4053 | +</div> |
| 4054 | +$8', |
| 4055 | + |
| 4056 | +'exif-iimcategory-ace' => 'Arts, culture and enterntainment', |
| 4057 | +'exif-iimcategory-clj' => 'Crime and law', |
| 4058 | +'exif-iimcategory-dis' => 'Disasters and accidents', |
| 4059 | +'exif-iimcategory-fin' => 'Economy and business', |
| 4060 | +'exif-iimcategory-edu' => 'Education', |
| 4061 | +'exif-iimcategory-evn' => 'Environment', |
| 4062 | +'exif-iimcategory-hth' => 'Health', |
| 4063 | +'exif-iimcategory-hum' => 'Human interest', |
| 4064 | +'exif-iimcategory-lab' => 'Labour', |
| 4065 | +'exif-iimcategory-lif' => 'Lifestyle and leisure', |
| 4066 | +'exif-iimcategory-pol' => 'Politics', |
| 4067 | +'exif-iimcategory-rel' => 'Religion and belief', |
| 4068 | +'exif-iimcategory-sci' => 'Science and technology', |
| 4069 | +'exif-iimcategory-soi' => 'Social issues', |
| 4070 | +'exif-iimcategory-spo' => 'Sports', |
| 4071 | +'exif-iimcategory-war' => 'War, conflict and unrest', |
| 4072 | +'exif-iimcategory-wea' => 'Weather', |
| 4073 | + |
4045 | 4074 | # External editor support |
4046 | 4075 | 'edit-externally' => 'Edit this file using an external application', |
4047 | 4076 | 'edit-externally-help' => '(See the [http://www.mediawiki.org/wiki/Manual:External_editors setup instructions] for more information)', |