Temporarily disable pre-upload SVG thumbnailing in Special:Upload and Special:UploadW...
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 12 Oct 2011 22:46:31 +0000 (22:46 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 12 Oct 2011 22:46:31 +0000 (22:46 +0000)
It's possible that this isn't SVG-specific though; large JPEGs are so far known to take a couple seconds and still pause the browser UI, but some SVGs hang Firefox 7/8/9 indefinitely when loaded as a data URI.

Upstream Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=694165

resources/mediawiki.special/mediawiki.special.upload.js

index d6f6e52..d7b86d7 100644 (file)
@@ -19,12 +19,13 @@ jQuery( function( $ ) {
         * Also excludes files over 10M to avoid going insane on memory usage.
         *
         * @todo is there a way we can ask the browser what's supported in <img>s?
+        * @todo put SVG back after working around Firefox 7 bug <https://bugzilla.wikimedia.org/show_bug.cgi?id=31643>
         *
         * @param {File} file
         * @return boolean
         */
        function fileIsPreviewable( file ) {
-               var     known = ['image/png', 'image/gif', 'image/jpeg', 'image/svg+xml'],
+               var     known = ['image/png', 'image/gif', 'image/jpeg'],
                        tooHuge = 10 * 1024 * 1024;
                return ( $.inArray( file.type, known ) !== -1 ) && file.size > 0 && file.size < tooHuge;
        }