image_tools

package
v0.0.2-beta.1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoMemory = errors.New("invalid memory assignation")
)

Functions

This section is empty.

Types

type ImageHandler

type ImageHandler interface {
	// ConvertImage makes a copy of the image in a new format
	ConvertImage(src, srcFmt, dst, dstFmt string) error

	// CreateCopy creates a full copy from the src image
	CreateCopy(src, dst string, sizeM int64) error

	// CreateChainedCopy creates a copy chained copy from src image
	CreateChainedCopy(src, dst string, sizeM int64) error

	// GetImageFormat returns the format of a given image
	GetImageFormat(path string) (string, error)

	// GetImageSize returns the real size of the image. For some formats
	// the size of the image will be larger than the size of the image
	// file itself.
	GetImageSize(path string) (uint64, error)
}

ImageHandler is the interface handling image files directly.

type QemuTools

type QemuTools struct {
	// contains filtered or unexported fields
}

func NewQemuHandler

func NewQemuHandler(logger hclog.Logger) *QemuTools

func (*QemuTools) ConvertImage

func (q *QemuTools) ConvertImage(src, srcFmt, dst, dstFmt string) error

ConvertImage makes a copy of the image in a new format

func (*QemuTools) CreateChainedCopy

func (q *QemuTools) CreateChainedCopy(src string, destination string, sizeM int64) error

CreateChainedCopy creates a copy chained copy from src image

func (*QemuTools) CreateCopy

func (q *QemuTools) CreateCopy(src, dst string, sizeM int64) error

CreateCopy creates a full copy from the src image

func (*QemuTools) GetImageFormat

func (q *QemuTools) GetImageFormat(path string) (string, error)

GetImageFormat gets the format of a given image

func (*QemuTools) GetImageSize

func (q *QemuTools) GetImageSize(path string) (uint64, error)

GetImageSize returns the real size of the image. For some formats the size of the image will be larger than the size of the image file itself.

Jump to

Keyboard shortcuts

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