extract

package
v0.0.0-...-f7ce0a2 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package extract provides "extract" sub command: extract all images from a GIF image.

Index

Constants

This section is empty.

Variables

View Source
var Extract = subcmd.DefineCommand("extract", "extract each frames from GIF", func(ctx context.Context, args []string) error {
	name := strings.Join(subcmd.Names(ctx), " ")
	fs := flag.NewFlagSet(name, flag.ExitOnError)
	var outdir string
	fs.StringVar(&outdir, "outdir", "", "output directory (default: base of input)")
	fs.Parse(args)
	if fs.NArg() != 1 {
		return errors.New("only one GIF can be extracted at a time")
	}
	input := fs.Arg(0)
	if outdir == "" {
		outdir = input[0 : len(input)-len(filepath.Ext(input))]
	}
	return extractFrames(outdir, input)
})

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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