diff --git a/libsquoosh/src/codecs.ts b/libsquoosh/src/codecs.ts index 6fdb5e82..e97c753c 100644 --- a/libsquoosh/src/codecs.ts +++ b/libsquoosh/src/codecs.ts @@ -282,7 +282,7 @@ export const codecs = { webp: { name: 'WebP', extension: 'webp', - detectors: [/^RIFF....WEBPVP8[LX ]/], + detectors: [/^RIFF....WEBPVP8[LX ]/s], dec: () => instantiateEmscriptenWasm(webpDec, webpDecWasm), enc: () => instantiateEmscriptenWasm(webpEnc, webpEncWasm), defaultEncoderOptions: { diff --git a/src/client/lazy-app/util/index.ts b/src/client/lazy-app/util/index.ts index 24a21f93..f7152182 100644 --- a/src/client/lazy-app/util/index.ts +++ b/src/client/lazy-app/util/index.ts @@ -95,7 +95,7 @@ const magicNumberMapInput = [ [/^I I/, 'image/tiff'], [/^II*/, 'image/tiff'], [/^MM\x00*/, 'image/tiff'], - [/^RIFF....WEBPVP8[LX ]/, 'image/webp'], + [/^RIFF....WEBPVP8[LX ]/s, 'image/webp'], [/^\xF4\xFF\x6F/, 'image/webp2'], [/^\x00\x00\x00 ftypavif\x00\x00\x00\x00/, 'image/avif'], [/^\xff\x0a/, 'image/jxl'],