summaryrefslogtreecommitdiffstats
path: root/vendor/golang.org/x/image/tiff/compress.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2021-10-17 00:47:22 +0200
committerGitHub <noreply@github.com>2021-10-17 00:47:22 +0200
commit4dd8bae5c91fa4aef09d865d8fef1acd84f90925 (patch)
treeffad9b242daccaf8c86d1c1fbd59032302bd3be9 /vendor/golang.org/x/image/tiff/compress.go
parent7ae45c42e712bd0e66c101f3f714c05aa1dc2104 (diff)
downloadmatterbridge-msglm-4dd8bae5c91fa4aef09d865d8fef1acd84f90925.tar.gz
matterbridge-msglm-4dd8bae5c91fa4aef09d865d8fef1acd84f90925.tar.bz2
matterbridge-msglm-4dd8bae5c91fa4aef09d865d8fef1acd84f90925.zip
Update dependencies (#1610)
* Update dependencies * Update module to go 1.17
Diffstat (limited to 'vendor/golang.org/x/image/tiff/compress.go')
-rw-r--r--vendor/golang.org/x/image/tiff/compress.go58
1 files changed, 0 insertions, 58 deletions
diff --git a/vendor/golang.org/x/image/tiff/compress.go b/vendor/golang.org/x/image/tiff/compress.go
deleted file mode 100644
index 3f176f00..00000000
--- a/vendor/golang.org/x/image/tiff/compress.go
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2011 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package tiff
-
-import (
- "bufio"
- "io"
-)
-
-type byteReader interface {
- io.Reader
- io.ByteReader
-}
-
-// unpackBits decodes the PackBits-compressed data in src and returns the
-// uncompressed data.
-//
-// The PackBits compression format is described in section 9 (p. 42)
-// of the TIFF spec.
-func unpackBits(r io.Reader) ([]byte, error) {
- buf := make([]byte, 128)
- dst := make([]byte, 0, 1024)
- br, ok := r.(byteReader)
- if !ok {
- br = bufio.NewReader(r)
- }
-
- for {
- b, err := br.ReadByte()
- if err != nil {
- if err == io.EOF {
- return dst, nil
- }
- return nil, err
- }
- code := int(int8(b))
- switch {
- case code >= 0:
- n, err := io.ReadFull(br, buf[:code+1])
- if err != nil {
- return nil, err
- }
- dst = append(dst, buf[:n]...)
- case code == -128:
- // No-op.
- default:
- if b, err = br.ReadByte(); err != nil {
- return nil, err
- }
- for j := 0; j < 1-code; j++ {
- buf[j] = b
- }
- dst = append(dst, buf[:1-code]...)
- }
- }
-}