Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SecurityError: The operation is insecure #157

Open
wscott20 opened this issue Sep 10, 2024 · 0 comments
Open

SecurityError: The operation is insecure #157

wscott20 opened this issue Sep 10, 2024 · 0 comments

Comments

@wscott20
Copy link

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant