Skip to content

image/png: no support for setting and retrieving the PPI/DPI #18365

Open
@rgeronimi

Description

@rgeronimi

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go1.7.4 darwin/amd64

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/raphaelgeronimi/Local/Others/Go workspace"
GORACE=""
GOROOT="/opt/local/lib/go"
GOTOOLDIR="/opt/local/lib/go/pkg/tool/darwin_amd64"
CC="/usr/bin/clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/zw/0zvr11l11975vn4gk7s4hrx00000gn/T/go-build732769753=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"

What did you do?

I need to mass-produce PNG chart images in high resolution - i.e., PPI at 2x-4x multiple of the default 72 value

What did you expect to see?

A new encoding method and/or an Options field to customize the PPI of the image being encoded. Similarly, extending the image.Config struct to be able to retrieve the PPI of a decoded image.

What did you see instead?

No method found.

I wrote a patch with the missing code. However the public API design needs to be discussed first as a "clean" API - i.e., adding an Options field to the Encode function to perfectly mirror the design of image/jpeg - is unfeasible as it would break the Go 1 compatibility

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureRequestIssues asking for a new feature that does not need a proposal.NeedsFixThe path to resolution is known, but the work has not been done.help wanted

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions