Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
image.onload = () => {
if (image.width !== image.height) {
resolve(false)
return
}
const canvas = document.createElement('canvas')
loadSkinToCanvas(canvas, image)
const ratio = canvas.width / 64
const context = canvas.getContext('2d')
if (!context) {
resolve(false)
return
}
for (let x = 46 * ratio; x < 48 * ratio; x += 1) {
for (let y = 52 * ratio; y < 64 * ratio; y += 1) {
if (!checkPixel(context, x, y)) {
resolve(false)
return
}
}
}