From: Brion Vibber Date: Sun, 25 Dec 2005 09:59:54 +0000 (+0000) Subject: * Don't delete thumbnails when refreshing exif metadata. This caused thumbs X-Git-Tag: 1.6.0~888 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=4f8cc9d1eeb10f46af11720ab204463fc071c121;p=lhc%2Fweb%2Fwiklou.git * Don't delete thumbnails when refreshing exif metadata. This caused thumbs to vanish mysteriously from time to time for files that didn't have metadata. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index d12ef2674f..6d6d0ca27e 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -350,6 +350,8 @@ fully support the editing toolbar, but was found to be too confusing. * (bug 4368) Don't show useless empty preview on new section creation * Don't show useless empty preview on new page creation * (bug 4377) "[" is not valid in URLs +* Don't delete thumbnails when refreshing exif metadata. This caused thumbs + to vanish mysteriously from time to time for files that didn't have metadata. === Caveats === diff --git a/includes/Image.php b/includes/Image.php index cd389da857..64e897d267 100644 --- a/includes/Image.php +++ b/includes/Image.php @@ -1143,6 +1143,15 @@ class Image return $files; } + /** + * Refresh metadata in memcached, but don't touch thumbnails or squid + */ + function purgeMetadataCache() { + clearstatcache(); + $this->loadFromFile(); + $this->saveToCache(); + } + /** * Delete all previously generated thumbnails, refresh metadata in memcached and purge the squid */ @@ -1150,9 +1159,7 @@ class Image global $wgInternalServer, $wgUseSquid; // Refresh metadata cache - clearstatcache(); - $this->loadFromFile(); - $this->saveToCache(); + $this->purgeMetadataCache(); // Delete thumbnails $files = $this->getThumbnails( $shared ); @@ -1502,7 +1509,7 @@ class Image $newver = Exif::version(); if ( !count( $ret ) || $purge || $oldver != $newver ) { - $this->purgeCache(); + $this->purgeMetadataCache(); $this->updateExifData( $newver ); } if ( isset( $ret['MEDIAWIKI_EXIF_VERSION'] ) )