mattermost-community-enterp.../vendor/github.com/oov/psd/compress_js.go
Claude ec1f89217a Merge: Complete Mattermost Server with Community Enterprise
Full Mattermost server source with integrated Community Enterprise features.
Includes vendor directory for offline/air-gapped builds.

Structure:
- enterprise-impl/: Enterprise feature implementations
- enterprise-community/: Init files that register implementations
- enterprise/: Bridge imports (community_imports.go)
- vendor/: All dependencies for offline builds

Build (online):
  go build ./cmd/mattermost

Build (offline/air-gapped):
  go build -mod=vendor ./cmd/mattermost

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 23:59:07 +09:00

41 lines
902 B
Go

//go:build !wasm && js
// +build !wasm,js
package psd
import (
"errors"
"io"
"github.com/gopherjs/gopherjs/js"
)
func decodePackBits(dest []byte, r io.Reader, width int, lines int, large bool) (read int, err error) {
intSize := get4or8(large) >> 1
b := make([]byte, lines*intSize)
var l int
if l, err = io.ReadFull(r, b); err != nil {
return
}
read += l
lens := js.Global.Get("$github.com/oov/psd$").Call("decodePackBitsLines", b, lines, large).Interface().([]uint)
if lens == nil {
return read, errors.New("psd: error occurred in decodePackBitsLines")
}
total := uint(0)
for _, ln := range lens {
total += ln
}
b = make([]byte, total)
if l, err = io.ReadFull(r, b); err != nil {
return
}
read += l
if !js.Global.Get("$github.com/oov/psd$").Call("decodePackBits", dest, b, lens).Bool() {
return read, errors.New("psd: error occurred in decodePackBits")
}
return
}