r71155 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71154‎ | r71155 | r71156 >
Date:09:44, 16 August 2010
Author:bawolff
Status:ok
Tags:
Comment:
Follow up to r71148 per cr comments. Clarify some comments,
supress warnings around iconv, and fix a really stupid spelling mistake.
Modified paths:
  • /branches/img_metadata/phase3/includes/media/PNGMetadataExtractor.php (modified) (history)

Diff [purge]

Index: branches/img_metadata/phase3/includes/media/PNGMetadataExtractor.php
@@ -19,7 +19,10 @@
2020 */
2121 self::$text_chunks = array(
2222 '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',
2427 'Model' => 'Model',
2528 'Make' => 'Make',
2629 'Author' => 'Artist',
@@ -27,11 +30,13 @@
2831 'Description' => 'ImageDescription',
2932 'Title' => 'ObjectName',
3033 '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',
3237 'Software' => 'Software',
3338 'Disclaimer' => 'Disclaimer',
3439 '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.
3641 'Label' => 'Label',
3742 /* Other potentially useful things - Creation Time, Document */
3843 );
@@ -156,7 +161,10 @@
157162 fseek( $fh, self::$CRC_size, SEEK_CUR );
158163 continue;
159164 }
 165+ wfSuppressWarnings();
160166 $content = iconv( 'ISO-8859-1', 'UTF-8', $content);
 167+ wfRestoreWarnings();
 168+
161169 if ( $content === false ) {
162170 throw new Exception( __METHOD__ . ": Read error (error with iconv)" );
163171 return;
@@ -201,7 +209,10 @@
202210 continue;
203211 }
204212
 213+ wfSuppressWarnings();
205214 $content = iconv( 'ISO-8859-1', 'UTF-8', $content);
 215+ wfRestoreWarnings();
 216+
206217 if ( $content === false ) {
207218 throw new Exception( __METHOD__ . ": Read error (error with iconv)" );
208219 return;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r71148Add support for extracting metadata in PNG iTXt, tXEt and zTXt chunks....bawolff20:39, 15 August 2010

Status & tagging log