transform

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: BSD-3-Clause Imports: 13 Imported by: 2

Documentation

Overview

Package resize provides methods for running a base image transformation application that can be imported alongside custom `transform.Transformation` and `gocloud.dev/blob` packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultFlagSet

func DefaultFlagSet() *flag.FlagSet

DefaultFlagSet returns a `flag.FlagSet` instance configured with the default flags for running an image transformation application.

func Run

func Run(ctx context.Context, logger *log.Logger) error

Run invokes the image transformation application using the default flags.

func RunWithFlagSet

func RunWithFlagSet(ctx context.Context, fs *flag.FlagSet, logger *log.Logger) error

Run invokes the image transformation application using a custom `flag.FlagSet` instance.

func RunWithOptions

func RunWithOptions(ctx context.Context, opts *RunOptions, paths ...string) error

Run invokes the image transformation application configured using 'opts'.

Types

type RunOptions

type RunOptions struct {
	// TranformationURIs is one or more `transform.Tranformation` URIs used to apply transformations to an image.
	TransformationURIs []string
	// SourceURI is a `gocloud.dev/blob.Bucket` URI specifying the location where images are read from.
	SourceURI string
	// SourceURI is a `gocloud.dev/blob.Bucket` URI specifying the location where images are written to.
	TargetURI string
	// ApplySuffix is an optional suffix to apply to the final image filename.
	ApplySuffix string
	// ImageFormat is an optional image format used to encode the final image.
	ImageFormat string
	// Logger is a `log.Logger` instance used for logging messages and feedback.
	Logger *log.Logger
}

RunOptions is a struct containing configuration details for running an image transformation application.

Jump to

Keyboard shortcuts

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