Index: branches/img_metadata/phase3/includes/media/PNGMetadataExtractor.php |
— | — | @@ -19,7 +19,10 @@ |
20 | 20 | */ |
21 | 21 | self::$text_chunks = array( |
22 | 22 | 'XML:com.adobe.xmp' => 'xmp', |
23 | | - 'Artist' => 'Artist', # this is unofficial, compared to Author, which is |
| 23 | + # Artist is unofficial. Author is the recommended |
| 24 | + # keyword in the PNG spec. However some people output |
| 25 | + # Artist so support both. |
| 26 | + 'Artist' => 'Artist', |
24 | 27 | 'Model' => 'Model', |
25 | 28 | 'Make' => 'Make', |
26 | 29 | 'Author' => 'Artist', |
— | — | @@ -27,11 +30,13 @@ |
28 | 31 | 'Description' => 'ImageDescription', |
29 | 32 | 'Title' => 'ObjectName', |
30 | 33 | 'Copyright' => 'Copyright', |
31 | | - 'Source' => 'Model', # Source as in original device used to make image |
| 34 | + # Source as in original device used to make image |
| 35 | + # not as in who gave you the image |
| 36 | + 'Source' => 'Model', |
32 | 37 | 'Software' => 'Software', |
33 | 38 | 'Disclaimer' => 'Disclaimer', |
34 | 39 | 'Warning' => 'ContentWarning', |
35 | | - 'URL' => 'Identifer', # Not sure if this is best mapping. Maybe WebStatement. |
| 40 | + 'URL' => 'Identifier', # Not sure if this is best mapping. Maybe WebStatement. |
36 | 41 | 'Label' => 'Label', |
37 | 42 | /* Other potentially useful things - Creation Time, Document */ |
38 | 43 | ); |
— | — | @@ -156,7 +161,10 @@ |
157 | 162 | fseek( $fh, self::$CRC_size, SEEK_CUR ); |
158 | 163 | continue; |
159 | 164 | } |
| 165 | + wfSuppressWarnings(); |
160 | 166 | $content = iconv( 'ISO-8859-1', 'UTF-8', $content); |
| 167 | + wfRestoreWarnings(); |
| 168 | + |
161 | 169 | if ( $content === false ) { |
162 | 170 | throw new Exception( __METHOD__ . ": Read error (error with iconv)" ); |
163 | 171 | return; |
— | — | @@ -201,7 +209,10 @@ |
202 | 210 | continue; |
203 | 211 | } |
204 | 212 | |
| 213 | + wfSuppressWarnings(); |
205 | 214 | $content = iconv( 'ISO-8859-1', 'UTF-8', $content); |
| 215 | + wfRestoreWarnings(); |
| 216 | + |
206 | 217 | if ( $content === false ) { |
207 | 218 | throw new Exception( __METHOD__ . ": Read error (error with iconv)" ); |
208 | 219 | return; |