Skip to content

Paste function panics #163

@daryl-williams

Description

@daryl-williams

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

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