golang/go

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

Open

#18,365 opened on Dec 17, 2016

View on GitHub
 (7 comments) (0 reactions) (0 assignees)Go (19,008 forks)batch import
FeatureRequestNeedsFixhelp wanted

Repository metrics

Stars
 (133,883 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

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

Contributor guide