diff --git a/src/pomf.ts b/src/pomf.ts index e770721..d0b31dd 100644 --- a/src/pomf.ts +++ b/src/pomf.ts @@ -16,12 +16,12 @@ settings.subscribe(b => { }); const getExt = (fn: string) => { - const isDum = fn!.match(/^([a-z0-9]{6}\.(?:jpe?g|png|webm|gif))/gi); + const isDum = fn!.match(/^[a-z0-9]{6}\./i); const isB64 = fn!.match(/^((?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=))?\.(gif|jpe?g|png|webm)/); const isExt = fn!.match(/\[.*=(.*)\]/); let ext; if (isDum) { - ext = isDum[0]; + ext = fn.split('.').slice(0, -1).join('.'); } else if (isB64) { ext = atob(isB64[1]); } else if (isExt) {