r99653 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99652‎ | r99653 | r99654 >
Date:22:46, 12 October 2011
Author:brion
Status:ok
Tags:
Comment:
Temporarily disable pre-upload SVG thumbnailing in Special:Upload and Special:UploadWizard; workaround for worst part so far of bug 31643: some SVG files hanging Firefox during pre-upload thumbnail generation.

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
Modified paths:
  • /trunk/extensions/UploadWizard/resources/mw.fileApi.js (modified) (history)
  • /trunk/phase3/resources/mediawiki.special/mediawiki.special.upload.js (modified) (history)

Diff [purge]

Index: trunk/phase3/resources/mediawiki.special/mediawiki.special.upload.js
@@ -19,12 +19,13 @@
2020 * Also excludes files over 10M to avoid going insane on memory usage.
2121 *
2222 * @todo is there a way we can ask the browser what's supported in <img>s?
 23+ * @todo put SVG back after working around Firefox 7 bug <https://bugzilla.wikimedia.org/show_bug.cgi?id=31643>
2324 *
2425 * @param {File} file
2526 * @return boolean
2627 */
2728 function fileIsPreviewable( file ) {
28 - var known = ['image/png', 'image/gif', 'image/jpeg', 'image/svg+xml'],
 29+ var known = ['image/png', 'image/gif', 'image/jpeg'],
2930 tooHuge = 10 * 1024 * 1024;
3031 return ( $.inArray( file.type, known ) !== -1 ) && file.size > 0 && file.size < tooHuge;
3132 }
Index: trunk/extensions/UploadWizard/resources/mw.fileApi.js
@@ -16,12 +16,13 @@
1717 * Also excludes files over 10M to avoid going insane on memory usage.
1818 *
1919 * @todo is there a way we can ask the browser what's supported in <img>s?
 20+ * @todo put SVG back after working around Firefox 7 bug <https://bugzilla.wikimedia.org/show_bug.cgi?id=31643>
2021 *
2122 * @param {File} file
2223 * @return boolean
2324 */
2425 isPreviewableFile: function( file ) {
25 - var known = [ 'image/png', 'image/gif', 'image/jpeg', 'image/svg+xml'],
 26+ var known = [ 'image/png', 'image/gif', 'image/jpeg'],
2627 tooHuge = 10 * 1024 * 1024;
2728 return ( $.inArray( file.type, known ) !== -1 ) && file.size > 0 && file.size < tooHuge;
2829 },

Follow-up revisions

RevisionCommit summaryAuthorDate
r99654MFT r99653reedy22:55, 12 October 2011
r99840Followup to r99653 (bug 31643) -- reenable client-side thumbnailing of SVGs o...brion02:23, 15 October 2011
r100493MFT r99653reedy02:43, 22 October 2011

Status & tagging log