This is a created article in which the information may have evolved or changed.
Recently to Go.image/tiff
Added support for formats such as Tile/gray/gray16/rgb16bit.
There are some features that will be perfected in the future.
The basic idea of the Go Language Image Library is to provide the perfect decoding function (only the first image of the file is supported).
While the coding function is relatively limited, mainly to support the basic different color models, TIFF specific features should not be fully supported.
Recently there are user feedback generated TIFF on Mac system does not browse normally (Issue6421).
And my own win7/64 can open the problematic image normally. tiffinfo
the tag (after the problem has been modified) has not seen anything unusual.
Then inadvertently using GIMP, you can't open a TIFF image with a Mac problem.
Now that the problem has been reproduced, finding the cause is much easier.
After a preliminary analysis, it was found that the problem was mainly for non-RGB images (grayscale and color palettes).
Then found that Go.image/tiff's encode function for non-RGB images are written extrasamples tags,
This function only works if the number of bands is greater than 3 of the RGB (see TIFF spec for details).
Of course, some programs with better tolerance can ignore invalid extrasamples tags (like many programs under Windows).
However, if you strictly follow the TIFF specification, there is a problem with the grayscale and palette formats that contain extrasamples tags.
After fixing the problem (CL13779043), GIMP will work (the Mac part is still waiting for user feedback).
After this bug found, still want to understand the TIFF format specification, otherwise it is easy to bring some wrong understanding of the implementation.
Of course, go.image/tiff
the tests also need to be perfected.
For a description of TIFF, please refer to: TIFF6.0 format Introduction