r75087 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75086‎ | r75087 | r75088 >
Date:14:50, 20 October 2010
Author:hartman
Status:ok
Tags:
Comment:
Add support to upload WebP files. Disabled by default and no thumbnailing support.
Relates to bug 25397
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/MimeMagic.php (modified) (history)
  • /trunk/phase3/includes/mime.info (modified) (history)
  • /trunk/phase3/includes/mime.types (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/MimeMagic.php
@@ -402,6 +402,7 @@
403403 // Formats we recognize magic numbers for
404404 'djvu', 'ogx', 'ogg', 'ogv', 'oga', 'spx',
405405 'mid', 'pdf', 'wmf', 'xcf', 'webm', 'mkv', 'mka',
 406+ 'webp',
406407
407408 // XML formats we sure hope we recognize reliably
408409 'svg',
@@ -548,6 +549,12 @@
549550 return "unknown/unknown";
550551 }
551552
 553+ /* Look for WebP */
 554+ if( strncmp( $head, "RIFF", 4 ) == 0 && strncmp( substr( $head, 8, 8), "WEBPVP8 ", 8 ) == 0 ) {
 555+ wfDebug( __METHOD__ . ": recognized file as image/webp\n" );
 556+ return "image/webp";
 557+ }
 558+
552559 /*
553560 * Look for PHP. Check for this before HTML/XML... Warning: this is a
554561 * heuristic, and won't match a file with a lot of non-PHP before. It
Index: trunk/phase3/includes/mime.types
@@ -85,6 +85,7 @@
8686 image/tiff tiff tif
8787 image/vnd.djvu djvu djv
8888 image/vnd.wap.wbmp wbmp
 89+image/webp webp
8990 image/x-cmu-raster ras
9091 image/x-icon ico
9192 image/x-ms-bmp bmp
Index: trunk/phase3/includes/mime.info
@@ -19,6 +19,7 @@
2020 image/x-bmp image/x-ms-bmp image/bmp application/x-bmp application/bmp [BITMAP]
2121 image/x-photoshop image/psd image/x-psd image/photoshop [BITMAP]
2222 image/vnd.djvu image/x.djvu image/x-djvu [BITMAP]
 23+image/webp [BITMAP]
2324
2425 image/svg+xml application/svg+xml application/svg image/svg [DRAWING]
2526 application/postscript [DRAWING]
Index: trunk/phase3/RELEASE-NOTES
@@ -181,6 +181,7 @@
182182 for versioning
183183 * Maintenance scripts get a --memory-limit option to override defaults (which
184184 is usually to set it to -1 to disable the limit)
 185+* (bug 25397) Allow uploading (not displaying) of WebP images, disabled by default
185186
186187 === Bug fixes in 1.17 ===
187188 * (bug 17560) Half-broken deletion moved image files to deletion archive

Status & tagging log