tiffpreview

package
v0.0.0-...-be17ed1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2026 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const MaxInputBytes = 64 * 1024 * 1024

Variables

View Source
var (
	ErrInputTooLarge = errors.New("TIFF image exceeds the input size limit")
	ErrImageTooLarge = errors.New("TIFF image exceeds the dimension limit")
)

Functions

func Convert

func Convert(ctx context.Context, source []byte, thumbnail bool) (output []byte, err error)

Convert 仅解码首个 IFD,生成浏览器可显示的 PNG;原件及后续帧保持不变。 16 位灰度优先采用 ImageJ 显示范围,否则按首帧的实际灰度范围拉伸。

func IsPath

func IsPath(path string) bool

IsPath 按文件系统路径识别 TIFF;URL 查询参数由调用方解析,不截断合法路径中的井号。

func ReadFileLimited

func ReadFileLimited(path string, limit int64) ([]byte, error)

Types

type Result

type Result struct {
	Data []byte
	Path string
	ETag string
}

func GetOrCreate

func GetOrCreate(ctx context.Context, source []byte, directory string, thumbnail, encrypted bool) (Result, error)

GetOrCreate 用内容摘要隔离预览及缩略图缓存;加密资源只返回请求内存中的 PNG。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址