From 416ee3f058eea8a16cea535810024f6e26791d73 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Fri, 13 May 2005 09:58:53 +0000 Subject: [PATCH] * Save '0' in img_metadata when no metadata has been found, to indicate that it shouldn't be checked again. --- includes/Image.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/includes/Image.php b/includes/Image.php index f7660848de..0e0c174c40 100644 --- a/includes/Image.php +++ b/includes/Image.php @@ -1167,6 +1167,8 @@ class Image function getExifData () { global $wgRequest; + if ( $this->metadata === '0' ) + return array(); $purge = $wgRequest->getVal( 'action' ) == 'purge'; $ret = unserialize ( $this->metadata ); @@ -1176,7 +1178,6 @@ class Image if ( !count( $ret ) || $purge || $oldver != $newver ) { $this->updateExifData( $newver ); - $ret = unserialize( $this->metadata ); } if ( isset( $ret['MEDIAWIKI_EXIF_VERSION'] ) ) unset( $ret['MEDIAWIKI_EXIF_VERSION'] ); @@ -1196,8 +1197,12 @@ class Image # Get EXIF data from image $exif = $this->retrieveExifData(); - $exif['MEDIAWIKI_EXIF_VERSION'] = $version; - $this->metadata = serialize( $exif ); + if ( count( $exif ) ) { + $exif['MEDIAWIKI_EXIF_VERSION'] = $version; + $this->metadata = serialize( $exif ); + } else { + $this->metadata = '0'; + } # Update EXIF data in database $dbw =& wfGetDB( DB_MASTER ); -- 2.20.1