Index: trunk/phase3/includes/MimeMagic.php |
— | — | @@ -402,6 +402,7 @@ |
403 | 403 | // Formats we recognize magic numbers for |
404 | 404 | 'djvu', 'ogx', 'ogg', 'ogv', 'oga', 'spx', |
405 | 405 | 'mid', 'pdf', 'wmf', 'xcf', 'webm', 'mkv', 'mka', |
| 406 | + 'webp', |
406 | 407 | |
407 | 408 | // XML formats we sure hope we recognize reliably |
408 | 409 | 'svg', |
— | — | @@ -548,6 +549,12 @@ |
549 | 550 | return "unknown/unknown"; |
550 | 551 | } |
551 | 552 | |
| 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 | + |
552 | 559 | /* |
553 | 560 | * Look for PHP. Check for this before HTML/XML... Warning: this is a |
554 | 561 | * 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 @@ |
86 | 86 | image/tiff tiff tif |
87 | 87 | image/vnd.djvu djvu djv |
88 | 88 | image/vnd.wap.wbmp wbmp |
| 89 | +image/webp webp |
89 | 90 | image/x-cmu-raster ras |
90 | 91 | image/x-icon ico |
91 | 92 | image/x-ms-bmp bmp |
Index: trunk/phase3/includes/mime.info |
— | — | @@ -19,6 +19,7 @@ |
20 | 20 | image/x-bmp image/x-ms-bmp image/bmp application/x-bmp application/bmp [BITMAP] |
21 | 21 | image/x-photoshop image/psd image/x-psd image/photoshop [BITMAP] |
22 | 22 | image/vnd.djvu image/x.djvu image/x-djvu [BITMAP] |
| 23 | +image/webp [BITMAP] |
23 | 24 | |
24 | 25 | image/svg+xml application/svg+xml application/svg image/svg [DRAWING] |
25 | 26 | application/postscript [DRAWING] |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -181,6 +181,7 @@ |
182 | 182 | for versioning |
183 | 183 | * Maintenance scripts get a --memory-limit option to override defaults (which |
184 | 184 | is usually to set it to -1 to disable the limit) |
| 185 | +* (bug 25397) Allow uploading (not displaying) of WebP images, disabled by default |
185 | 186 | |
186 | 187 | === Bug fixes in 1.17 === |
187 | 188 | * (bug 17560) Half-broken deletion moved image files to deletion archive |