Sometimes GIF data may be invalid due to incorrect encoding, corrupted transmission etc. This causes problems when attempting to call drawImage() to the canvas context. In most cases, the frame data will be undefined so we must check for this before attempting drawImage() just in case. There’s probably a more elegant way to handle this, but it seems to work for my use-case.
@UXVirtual i am so sorry for the late reply.
thank you so much for your PR 🙏
i need to close this as the branch got conflicted.
but i added your code here and added you as a contributor.
Sometimes GIF data may be invalid due to incorrect encoding, corrupted transmission etc. This causes problems when attempting to call
drawImage()
to the canvas context. In most cases, the frame data will beundefined
so we must check for this before attemptingdrawImage()
just in case. There’s probably a more elegant way to handle this, but it seems to work for my use-case.