r9122 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r9121‎ | r9122 | r9123 >
Date:15:59, 21 May 2005
Author:eloquence
Status:old
Tags:
Comment:
don't choke if EXIF library is not available
Modified paths:
  • /trunk/phase3/includes/Image.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Image.php
@@ -188,7 +188,8 @@
189189 * Load metadata from the file itself
190190 */
191191 function loadFromFile() {
192 - global $wgUseSharedUploads, $wgSharedUploadDirectory, $wgLang;
 192+ global $wgUseSharedUploads, $wgSharedUploadDirectory, $wgLang,
 193+ $wgShowEXIF;
193194 $fname = 'Image::loadFromFile';
194195 wfProfileIn( $fname );
195196 $this->imagePath = $this->getFullPath();
@@ -267,7 +268,7 @@
268269 $this->dataLoaded = true;
269270
270271
271 - if ($this->fileExists) $this->metadata = serialize ( $this->retrieveExifData() ) ;
 272+ if ($this->fileExists && $wgShowEXIF) $this->metadata = serialize ( $this->retrieveExifData() ) ;
272273 else $this->metadata = serialize ( array() ) ;
273274
274275 if ( isset( $gis['bits'] ) ) $this->bits = $gis['bits'];

Status & tagging log