imgconv

package module
v0.0.0-...-cbbaa2a Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT Imports: 12 Imported by: 0

README

imgconv

imgconv is a tool for converting images into images of other formats.

GitHub watchers GitHub stars GitHub forks GitHub last commit GitHub repo size GitHub license

Install

go get

go get -u github.com/XdpCs/imgconv

go mod

require github.com/XdpCs/imgconv

cli

go run cli.go -url https://avatars.githubusercontent.com/u/72180730 -format webp

If you want to convert an image from a URL, you can use the -url flag.

More information can be found by running go run cli.go -h.

License

imgconv is under the MIT. Please take a look at LICENSE for more information.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckImageFormat

func CheckImageFormat(format string) error

func ContentTypeFormat

func ContentTypeFormat(contentType string) (string, error)

func ConvertFormat

func ConvertFormat(input *InputImage, output *OutputImage) error

func DecodeFactory

func DecodeFactory(format string) (func(io.Reader) (image.Image, error), error)

func EncodeFactory

func EncodeFactory(format string) (func(io.Writer, image.Image) error, error)

func FileFormat

func FileFormat(path string) (string, error)

Types

type InputImage

type InputImage struct {
	Reader io.Reader
	Format string
	Name   string
}

func HttpInputImageFile

func HttpInputImageFile(url string) (*InputImage, error)

func LocalInputImageFile

func LocalInputImageFile(path string) (*InputImage, error)

type OutputImage

type OutputImage struct {
	Writer io.Writer
	Format string
	Name   string
}

func LocalOutputImageFile

func LocalOutputImageFile(name, dir, format string) (*OutputImage, error)

Jump to

Keyboard shortcuts

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