Skip to content

x/image/tiff: invalid format: wrong number of samples for RGB #11413

Open
golang/image
#21
@noblehng

Description

@noblehng

This tiff file can't be decoded using "golang.org/x/image/tiff". It give out following error message:

tiff: invalid format: wrong number of samples for RGB

Test program:

package main

import (
        "bytes"
        "io/ioutil"
        "os"

        "golang.org/x/image/tiff"
)

func main() {
        data, _ := ioutil.ReadFile(os.Args[1])
        _, err := tiff.Decode(bytes.NewReader(data))
        if err != nil {
                println(err.Error())
        }   
}

Use cgo binding to libtiff decode this file without problem.

go version

go version go1.4.2 linux/amd64

tiffinfo

TIFF Directory at offset 0x83d68 (540008)
  Image Width: 300 Image Length: 450
  Bits/Sample: 8
  Sample Format: unsigned integer
  Compression Scheme: None
  Photometric Interpretation: RGB color
  Samples/Pixel: 4
  Rows/Strip: 1
  Planar Configuration: separate image planes

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions