This commit is contained in:
Your Name
2026-08-11 17:41:36 +08:00
parent cfe4c82c90
commit 03fe4ddf9d
18771 changed files with 3617239 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
import GIF from 'omggif';
const MIME_TYPE = 'image/gif';
export default () => ({
mime: { [MIME_TYPE]: ['gif'] },
constants: {
MIME_GIF: MIME_TYPE
},
decoders: {
[MIME_TYPE]: data => {
const gifObj = new GIF.GifReader(data);
const gifData = Buffer.alloc(gifObj.width * gifObj.height * 4);
gifObj.decodeAndBlitFrameRGBA(0, gifData);
return {
data: gifData,
width: gifObj.width,
height: gifObj.height
};
}
}
});