We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Please answer these questions before submitting your issue. Thanks!
go version
go version go1.7.1 darwin/amd64
go env
GOARCH="amd64" GOBIN="" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/tmp/gopath:/Users/artyom/gopath" GORACE="" GOROOT="/Users/artyom/Library/go" GOTOOLDIR="/Users/artyom/Library/go/pkg/tool/darwin_amd64" CC="clang" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/lb/3rk8rqs53czgb4v35w_342xc0000gn/T/go-build425021710=/tmp/go-build -gno-record-gcc-switches -fno-common" CXX="clang++" CGO_ENABLED="1"
If possible, provide a recipe for reproducing the error. A complete runnable program is good. A link on play.golang.org is best.
/tmp/bad.png
Either no error message or png.UnsupportedError text.
png: invalid format: chunk out of order
Initially I thought that file was incorrect but that doesn't seem to be the case:
$ pngcheck -v -p /tmp/bad.png File: /tmp/bad.png (3616 bytes) chunk IHDR at offset 0x0000c, length 13 128 x 128 image, 24-bit RGB, non-interlaced chunk tRNS at offset 0x00025, length 6 red = 0x00ff, green = 0x00ff, blue = 0x00ff chunk IDAT at offset 0x00037, length 3541 zlib: deflated, 32K window, superfast compression chunk IEND at offset 0x00e18, length 0 No errors detected in /tmp/bad.png (4 chunks, 92.6% compression).
It seems to have tRNS chunk but no PLTE chunk, as it's a truecolor transparent file, which is valid per spec. Ordering seem to be valid as well.
Applying the following patch:
diff --git i/src/image/png/reader.go w/src/image/png/reader.go index 2dd5ed8..6159323 100644 --- i/src/image/png/reader.go +++ w/src/image/png/reader.go @@ -709,7 +709,7 @@ func (d *decoder) parseChunk() error { d.stage = dsSeenPLTE return d.parsePLTE(length) case "tRNS": - if d.stage != dsSeenPLTE { + if d.stage != dsSeenPLTE && d.stage != dsSeenIHDR { return chunkOrderError } d.stage = dsSeentRNS
results in error reported as png: unsupported feature: truecolor transparency which seems to be the correct message for this case.
png: unsupported feature: truecolor transparency
/cc @nigeltao
The text was updated successfully, but these errors were encountered:
CL https://golang.org/cl/32139 mentions this issue.
Sorry, something went wrong.
de4b065
No branches or pull requests
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?What operating system and processor architecture are you using (
go env
)?What did you do?
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
/tmp/bad.png
.What did you expect to see?
Either no error message or png.UnsupportedError text.
What did you see instead?
Initially I thought that file was incorrect but that doesn't seem to be the case:
It seems to have tRNS chunk but no PLTE chunk, as it's a truecolor transparent file, which is valid per spec. Ordering seem to be valid as well.
Applying the following patch:
results in error reported as
png: unsupported feature: truecolor transparency
which seems to be the correct message for this case./cc @nigeltao
The text was updated successfully, but these errors were encountered: