media

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package media 提供 OFD 包中图像资源的读取和解码能力。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(reader ContentReader, filename string) (image.Image, error)

Decode 从包内容读取器中读取并解码栅格图像。

func DecodeBytes added in v0.1.0

func DecodeBytes(data []byte) (image.Image, error)

DecodeBytes 从内存中的图像字节直接解码栅格图像。

func ExtractFirstImage

func ExtractFirstImage(filename string) (image.Image, error)

ExtractFirstImage 从基于 ZIP 的文件中提取第一张可以解码的图片。

func IsImageExtension

func IsImageExtension(ext string) bool

IsImageExtension 判断扩展名是否为支持的栅格图片格式。

Types

type ContentReader

type ContentReader interface {
	Read(string) ([]byte, error)
}

ContentReader 提供读取文件解压后内容的能力。

Jump to

Keyboard shortcuts

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