Skip to content

Improvement to output files #184

Open
@WillianBR

Description

@WillianBR

@fogleman,

I have noticed many examples from "fogleman/gg" save it output image file to "out.png".

That can be tricky!

I would like to suggest two additional lines, who it'll save the PNG with the same name of executable. Changing the extension only!

outPNG := strings.ReplaceAll(filepath.Base(os.Args[0]), filepath.Ext(os.Args[0]), ".png")
dc.SavePNG(outPNG)

I have the habit of build all the samples and test it one at the time.
But this litlte folks overwrite the old output file.

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