Fix the frames durations in the generated GIF images

This commit is contained in:
Mohammad Fares 2018-08-25 01:31:33 +03:00
parent 2306e765b3
commit 5ff5c06116

View File

@ -201,8 +201,10 @@ function mergeFrames(records, options, frameDimensions) {
progressBar.tick();
// Set delay
gif.setDelay(frame.delay);
// Set the duration (the delay of the next frame)
// The % is used to take the delay of the first frame
// as the duration of the last frame
gif.setDelay(records[(index + 1) % framesCount].delay);
// Add frames
gif.addFrame(png.data);