package main

import (
    "bytes"
    "golang.org/x/image/tiff"
)

func main() {
    cfg, err := tiff.DecodeConfig(bytes.NewReader([]byte(data)))
    if err != nil || cfg.Width*cfg.Height > 1e6 {
        return
    }
    img, err := tiff.Decode(bytes.NewReader([]byte(data)))
    if err != nil {
        return
    }
    var w bytes.Buffer
    err = tiff.Encode(&w, img, nil)
    if err != nil {
        panic(err)
    }
}

var data = "II*\x00Z\x02\x00\x00000000000000" +
    "00000000000000000000" +
    "00000000000000000000" +
    "00000000000000000000" +
    "00000000000000000000" +
    "00000000000000000000" +
    "00000000000000000000" +
    "00000000000000000000" +
    "00000000000000000000" +
    "00000000000000000000" +
    "00000000000000000000" +
    "00000000000000000000" +
    "00000000000000000000" +
    "00000000000000000000" +
    "00000000000000000000" +
    "00000000000000000000" +
    "00000000000000000000" +
    "00000000000000000000" +
    "00000000000000000000" +
    "00000000000000000000" +
    "00000000000000000000" +
    "00000000000000000000" +
    "00000000000000000000" +
    "00000000000000000000" +
    "00000000000000000000" +
    "00000000000000000000" +
    "0.000000000000000000" +
    "00000000000000000000" +
    "00000000000000000000" +
    "00000000000000000000" +
    "00\x10\x00000000000000\x00\x01\x03\x00" +
    "0\x00\x00\x000\x00\x00\x00\x01\x01\x03\x00\x01\x00\x00\x000\x0000" +
    "\x02\x01\x03\x00\x01\x00\x00\x00\x00\x0000\x03\x01\x03\x00\x01\x00\x00\x00" +
    "\x05\x80000000000000000000" +
    "00000000\x11\x01\x04\x000\x00\x00\x000\x00\x00\x00" +
    "00000000000000000000" +
    "0000000000000000\x17\x01\x04\x00" +
    "0\x00\x00\x000\x02\x00\x00000000000000" +
    "00000000000000000000" +
    "0000000000000000"
