davidmz / apng-canvas

APNG implementation on canvas.
https://davidmz.github.io/apng-canvas/
MIT License
668 stars 93 forks source link

fix: multiple images convert to the same one #19

Closed lemon0815 closed 5 years ago

lemon0815 commented 5 years ago

When I load more than one image that I want to transform to canvas, they will all be the same as the first. Because using element as keys of Object, they will all become "[object HTMLImageElement]"

davidmz commented 5 years ago

Hi, I'm sorry for the delay, but honestly, I don't understand the error. The hash of url2promise is used only in the function parseURL and parseURL uses a string as a key, not HTMLImageElement.

Could you show the code that causes the error?

lemon0815 commented 5 years ago

Thank you for your replay, I think of apng-canvas as another repository ajpng, the code in AJPNG.animateContext AJPNG.parseURL(url) should be
AJPNG.parseURL(url.src),or it will cause the error. The repository doesn't have the problem, sorry for bother you.

davidmz commented 5 years ago

Ок, I close this.