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

x/image/tiff: compressed tiffs are invalid (at least on Mac OS X) #26360

Open
cantino opened this issue Jul 13, 2018 · 6 comments
Open

x/image/tiff: compressed tiffs are invalid (at least on Mac OS X) #26360

cantino opened this issue Jul 13, 2018 · 6 comments

Comments

@cantino
Copy link

@cantino cantino commented Jul 13, 2018

Please answer these questions before submitting your issue. Thanks!

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

go version go1.10.3 darwin/amd64

Does this issue reproduce with the latest release?

I'm on go1.10.

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

GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/xxx/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/xxx/projects/go"
GORACE=""
GOROOT="/usr/local/opt/go/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/opt/go/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/kc/_mt5mw0j5ksfg846hgllc5lr0000gn/T/go-build015281372=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Here is a reproduction case.

What did you expect to see?

A valid white tiff.

What did you see instead?

A system error.

@gopherbot gopherbot added this to the Unreleased milestone Jul 13, 2018
@opennota

This comment has been minimized.

Copy link

@opennota opennota commented Jul 13, 2018

Works for me on linux. Perhaps Mac OS X doesn't support TIFF compression?

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Jul 13, 2018

@cantino

This comment has been minimized.

Copy link
Author

@cantino cantino commented Jul 13, 2018

OS X can definitely support Deflate, at least in some contexts. This issue may have something to do with pixel count. When I set width, height := 2104, 2736 (half the width, same height), the resulting compressed file works fine.

@prl900

This comment has been minimized.

Copy link

@prl900 prl900 commented Jul 17, 2018

I'm wondering if this is related to #24657. The issue was resolved for Gray16 images but I've just realised other types (including RGBA64), will have the same problem. Although this issue affects the decoding functionality there might be a similar problem affecting the encoding part.

As background, the problem that I'm referring to appears when the internal tile defined in a tiff does not align evenly with the total size of the image. If not related, I'll open a new issue to fix this one.

@cantino

This comment has been minimized.

Copy link
Author

@cantino cantino commented Feb 24, 2019

@prl900 did you ever investigate this? I'm hoping to use golang to generate tiffs, but currently cannot due to this issue.

@prl900

This comment has been minimized.

Copy link

@prl900 prl900 commented Feb 24, 2019

I think the problem you are experiencing is related with the encodeRGBA64 whereas the problem that I previously commented was related to the decoding functions.

Regardless, I've run your code on my mac (OS mojave) and I can open both tiffs (compressed and non-compressed) with Preview.

screen shot 2019-02-25 at 10 03 20 am

Happy to help to find out what the problem might be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.