* Don't delete thumbnails when refreshing exif metadata. This caused thumbs
authorBrion Vibber <brion@users.mediawiki.org>
Sun, 25 Dec 2005 09:59:54 +0000 (09:59 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sun, 25 Dec 2005 09:59:54 +0000 (09:59 +0000)
  to vanish mysteriously from time to time for files that didn't have metadata.

RELEASE-NOTES
includes/Image.php

index d12ef26..6d6d0ca 100644 (file)
@@ -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 ===
index cd389da..64e897d 100644 (file)
@@ -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'] ) )