-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
Using this gif with the code below https://media1.giphy.com/media/HnKSuvC39SdOM/source.gif
I am getting this error on GifUtil.write():
RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 and <= 43818. Received 43820
Is this a bug or am I doing something wrong? I'm trying to downsize the gif to 160x160px.
var filePath = "pathtofile.gif"
await GifUtil.read(filePath)
.then(async inputGif => {
//Loop through each frame
for (var i=0; i<inputGif.frames.length; i++){
//Modify the frame image buffer with jimp
var newImgBuffer = await GifUtil.copyAsJimp(jimp, inputGif.frames[i])
.resize(160, 160) // resize
.getBufferAsync(jimp.AUTO)
inputGif.frames[i].bitmap.height = 160
inputGif.frames[i].bitmap.width = 160
inputGif.frames[i].bitmap.data = newImgBuffer
}
//Pass inputGif to write() to preserve the original GIF's specs.
return GifUtil.write(filePath, inputGif.frames, inputGif)
});
Metadata
Metadata
Assignees
Labels
No labels