imgconv

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: MIT Imports: 10 Imported by: 0

README

imgconv

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertAll

func ConvertAll(root string, to, from Format) error

ConvertAllは指定したディレクトリ以下の画像ファイルの変換を行う 変換前の形式をfromで変換後の形式をtoで指定する

func Encode

func Encode(w io.Writer, img image.Image, f Format) error

Encodeは画像をio.Readerからデータを読み込みimage.Image型に変換する 変換する画像形式はfで指定する

func ReplaceExt

func ReplaceExt(path string, f Format) string

ReplaceExtは拡張子を指定した形式のものに書き換える

Types

type Format

type Format int

Formatは画像形式を表す

const (
	Unkown Format = iota
	PNG
	JPEG
	TIFF
	GIF
)

func Decode

func Decode(r io.Reader) (image.Image, Format, error)

Decodeはio.Readerからデータを読み込みimage.Image型に変換する 第2戻り値で画像の形式を返す

func FormatFromPath

func FormatFromPath(path string) Format

FormatFromPathは指定したパスの拡張子から画像形式を取得する

func (Format) Ext

func (f Format) Ext() string

Extは画像形式に対応する拡張子を取得する

func (*Format) Set

func (f *Format) Set(s string) error

Setは文字列形式から対応する画像形式を設定する

func (Format) String

func (f Format) String() string

Stringは画像形式に対応する文字列を返す

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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