Skip to content

Commit

Permalink
Changed frameInfo.delay value whent it is equal to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
ShenpaiSharma committed Feb 1, 2021
1 parent 5db68fb commit 0002ceb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/image/loading_displaying.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,13 @@ function _createGif(
loadGIFFrameIntoImage(j, gifReader);
const imageData = new ImageData(framePixels, pImg.width, pImg.height);
pImg.drawingContext.putImageData(imageData, 0, 0);
let frameDelay = frameInfo.delay;
if (frameDelay === 0) {
frameDelay = 10;
}
frames.push({
image: pImg.drawingContext.getImageData(0, 0, pImg.width, pImg.height),
delay: frameInfo.delay * 10 //GIF stores delay in one-hundredth of a second, shift to ms
delay: frameDelay * 10 //GIF stores delay in one-hundredth of a second, shift to ms
});
}

Expand Down

0 comments on commit 0002ceb

Please sign in to comment.