fix canvas image tainted & use jsDoc