Merge "Making missing old files not try to render a thumbnail"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 28 Aug 2014 07:43:26 +0000 (07:43 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 28 Aug 2014 07:43:26 +0000 (07:43 +0000)
1  2 
includes/filerepo/file/File.php

@@@ -679,7 -679,7 +679,7 @@@ abstract class File 
        }
  
        /**
 -       * Returns the mime type of the file.
 +       * Returns the MIME type of the file.
         * Overridden by LocalFile, UnregisteredLocalFile
         * STUB
         *
         */
        function canRender() {
                if ( !isset( $this->canRender ) ) {
-                       $this->canRender = $this->getHandler() && $this->handler->canRender( $this );
+                       $this->canRender = $this->getHandler() && $this->handler->canRender( $this ) && $this->exists();
                }
  
                return $this->canRender;
        /**
         * Creates a temp FS file with the same extension and the thumbnail
         * @param string $thumbPath Thumbnail path
 -       * @returns TempFSFile
 +       * @return TempFSFile
         */
        protected function makeTransformTmpFile( $thumbPath ) {
                $thumbExt = FileBackend::extensionFromPath( $thumbPath );
         * Hook into transform() to allow migration of thumbnail files
         * STUB
         * Overridden by LocalFile
 +       * @param string $thumbName
         */
        function migrateThumbFile( $thumbName ) {
        }
        /**
         * Get last thumbnailing error.
         * Largely obsolete.
 +       * @return string
         */
        function getLastError() {
                return $this->lastError;
         * @note Use getWidth()/getHeight() instead of this method unless you have a
         *  a good reason. This method skips all caches.
         *
 -       * @param string $fileName The path to the file (e.g. From getLocalPathRef() )
 +       * @param string $filePath The path to the file (e.g. From getLocalPathRef() )
         * @return array The width, followed by height, with optionally more things after
         */
        function getImageSize( $filePath ) {