mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-13 01:07:18 +00:00
Fix WebP sniffing some more
This commit is contained in:
@@ -282,7 +282,7 @@ export const codecs = {
|
|||||||
webp: {
|
webp: {
|
||||||
name: 'WebP',
|
name: 'WebP',
|
||||||
extension: 'webp',
|
extension: 'webp',
|
||||||
detectors: [/^RIFF....WEBPVP8[LX ]/],
|
detectors: [/^RIFF....WEBPVP8[LX ]/s],
|
||||||
dec: () => instantiateEmscriptenWasm(webpDec, webpDecWasm),
|
dec: () => instantiateEmscriptenWasm(webpDec, webpDecWasm),
|
||||||
enc: () => instantiateEmscriptenWasm(webpEnc, webpEncWasm),
|
enc: () => instantiateEmscriptenWasm(webpEnc, webpEncWasm),
|
||||||
defaultEncoderOptions: {
|
defaultEncoderOptions: {
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ const magicNumberMapInput = [
|
|||||||
[/^I I/, 'image/tiff'],
|
[/^I I/, 'image/tiff'],
|
||||||
[/^II*/, 'image/tiff'],
|
[/^II*/, 'image/tiff'],
|
||||||
[/^MM\x00*/, 'image/tiff'],
|
[/^MM\x00*/, 'image/tiff'],
|
||||||
[/^RIFF....WEBPVP8[LX ]/, 'image/webp'],
|
[/^RIFF....WEBPVP8[LX ]/s, 'image/webp'],
|
||||||
[/^\xF4\xFF\x6F/, 'image/webp2'],
|
[/^\xF4\xFF\x6F/, 'image/webp2'],
|
||||||
[/^\x00\x00\x00 ftypavif\x00\x00\x00\x00/, 'image/avif'],
|
[/^\x00\x00\x00 ftypavif\x00\x00\x00\x00/, 'image/avif'],
|
||||||
[/^\xff\x0a/, 'image/jxl'],
|
[/^\xff\x0a/, 'image/jxl'],
|
||||||
|
|||||||
Reference in New Issue
Block a user