Some problems of Go.image/tiff

Source: Internet
Author: User
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. tiffinfothe 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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.