don't choke if EXIF library is not available
authorErik Moeller <erik@users.mediawiki.org>
Sat, 21 May 2005 15:59:30 +0000 (15:59 +0000)
committerErik Moeller <erik@users.mediawiki.org>
Sat, 21 May 2005 15:59:30 +0000 (15:59 +0000)
includes/Image.php

index 2b49627..6b53b5c 100644 (file)
@@ -188,7 +188,8 @@ class Image
         * Load metadata from the file itself
         */
        function loadFromFile() {
-               global $wgUseSharedUploads, $wgSharedUploadDirectory, $wgLang;
+               global $wgUseSharedUploads, $wgSharedUploadDirectory, $wgLang,
+                      $wgShowEXIF;
                $fname = 'Image::loadFromFile';
                wfProfileIn( $fname );
                $this->imagePath = $this->getFullPath();
@@ -267,7 +268,7 @@ class Image
                $this->dataLoaded = true;
                
                
-               if ($this->fileExists) $this->metadata = serialize ( $this->retrieveExifData() ) ;
+               if ($this->fileExists && $wgShowEXIF) $this->metadata = serialize ( $this->retrieveExifData() ) ;
                else $this->metadata = serialize ( array() ) ;
                
                if ( isset( $gis['bits'] ) )  $this->bits = $gis['bits'];