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

Paste function panics #163

Open
daryl-williams opened this issue Jun 27, 2023 · 0 comments
Open

Paste function panics #163

daryl-williams opened this issue Jun 27, 2023 · 0 comments

Comments

@daryl-williams
Copy link

I am learning how to use the imaging package but have run into the following runtime error:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x20 pc=0x1026fe7f0]

The following code snippet:

source_image, err := imaging.Open(input_file)
if err != nil {
    log.Fatalf("Error: failed to open image \"%v\", error = %v\n", input_file, err)
}
new_image := imaging.New(1801, 1194, color.NRGBA{0, 0, 0, 0})
new_image = imaging.Paste(new_image, src_image, image.Pt(0, 0))

Unfortunately I have no idea how figure this out, any help would be much appreciated.

Regards,

Daryl

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