// Formats we recognize magic numbers for
'djvu', 'ogx', 'ogg', 'ogv', 'oga', 'spx',
'mid', 'pdf', 'wmf', 'xcf', 'webm', 'mkv', 'mka',
// Formats we recognize magic numbers for
'djvu', 'ogx', 'ogg', 'ogv', 'oga', 'spx',
'mid', 'pdf', 'wmf', 'xcf', 'webm', 'mkv', 'mka',
+ /* Look for WebP */
+ if( strncmp( $head, "RIFF", 4 ) == 0 && strncmp( substr( $head, 8, 8), "WEBPVP8 ", 8 ) == 0 ) {
+ wfDebug( __METHOD__ . ": recognized file as image/webp\n" );
+ return "image/webp";
+ }
+
/*
* Look for PHP. Check for this before HTML/XML... Warning: this is a
* heuristic, and won't match a file with a lot of non-PHP before. It
/*
* Look for PHP. Check for this before HTML/XML... Warning: this is a
* heuristic, and won't match a file with a lot of non-PHP before. It