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

image/png: support custom zlib compression levels #8499

Closed
LukeMauldin opened this issue Aug 8, 2014 · 5 comments
Closed

image/png: support custom zlib compression levels #8499

LukeMauldin opened this issue Aug 8, 2014 · 5 comments

Comments

@LukeMauldin
Copy link

@LukeMauldin LukeMauldin commented Aug 8, 2014

In Go 1.3 there is no way to specify the zlib encoding level when writing a png image.

Request a new function, png.EncodeLevel(w io.Writer, m image.Image, level int) be added.
 The level could then be passed to zlib.NewWriter in image/png/writer.go:259
@minux
Copy link
Member

@minux minux commented Aug 8, 2014

Comment 1:

Labels changed: added release-none, repo-main.

@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Aug 9, 2014

Comment 2:

EncodeLevel is too specific and not future-proof.
I'd rather see:
package png
type Encoder struct {
    Level int
    .... future ...
}
func (e *Encoder) Encoder(w io.Writer, m image.Image) error {
    ...
}
@LukeMauldin
Copy link
Author

@LukeMauldin LukeMauldin commented Aug 15, 2014

Comment 3:

Sounds good to me
@gopherbot
Copy link

@gopherbot gopherbot commented Aug 27, 2014

Comment 4:

CL https://golang.org/cl/129190043 mentions this issue.
@nigeltao
Copy link
Contributor

@nigeltao nigeltao commented Aug 28, 2014

Comment 5:

This issue was closed by revision 98e5a44.

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 25, 2016
wheatman added a commit to wheatman/go-akaros that referenced this issue Jun 25, 2018
In order to support different compression levels, make the
encoder type public, and add an Encoder method to it.

Fixes golang#8499.

LGTM=nigeltao
R=nigeltao, ruiu
CC=golang-codereviews
https://golang.org/cl/129190043
wheatman added a commit to wheatman/go-akaros that referenced this issue Jul 9, 2018
In order to support different compression levels, make the
encoder type public, and add an Encoder method to it.

Fixes golang#8499.

LGTM=nigeltao
R=nigeltao, ruiu
CC=golang-codereviews
https://golang.org/cl/129190043
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.