Skip to content

SecurityError: The operation is insecure #157

@wscott20

Description

@wscott20

I made a makeGif function that takes in an array of <img>s (code for it is below) but when I try to call it using an array I made of <img>s with base64 urls from a small canvas but it kept saying SecurityError: The operation is insecure. I tried debugging and found out the line that's causing the error is gif.render()

//I had an array of base64 url strings
let imageFrames = base64urls.map(e=>{
    let img = new Image()
    img.src = e
    return img
})
function makeGif(images) {
    let gif = new GIF({
        workers: 2,
        quality: 10,
        workerScript: 'dist/gif.worker.js' //made sure the file path was correct
    })
    images.forEach(img=>gif.addFrame(img))
    gif.on('finished',blob=>open(URL.createObjectURL(blob)))
    gif.render()
}
makeGif(imageFrames)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions