imgconv

package
v0.0.0-...-c99bb14 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToPng

func ConvertToPng(imageFile *ImageFile) error

ConvertToPng converts a jpg file to a png file.

func GetFileNameWithoutExt

func GetFileNameWithoutExt(path string) string

GetFileNameWithoutExt returns the file name without the extension

func HandleError

func HandleError(path string)

HandleError prints an error message to stderr

func WalkJpg

func WalkJpg(root string, converter ImageConverter) error

WalkJpg walks the file tree rooted at root, calling converter.Convert for each jpg file in the tree.

Types

type ImageConverter

type ImageConverter interface {
	Convert(path string) error
}

type ImageFile

type ImageFile struct {
	Path string
	Img  image.Image
}

func NewImageFile

func NewImageFile(path string) (*ImageFile, error)

NewImageFile returns a new ImageFile.

type JpgToPngConverter

type JpgToPngConverter struct{}

func (*JpgToPngConverter) Convert

func (c *JpgToPngConverter) Convert(path string) error

Convert converts a jpg file to a png file.

Jump to

Keyboard shortcuts

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