photoprism/internal/commands/show_thumb_sizes.go
Michael Mayer 3cf1c699df Video: Refactor FFmpeg Transcoding Size Limit #3466 #3498 #3549
Signed-off-by: Michael Mayer <michael@photoprism.app>
2023-07-18 15:15:04 +02:00

29 lines
700 B
Go

package commands
import (
"fmt"
"github.com/urfave/cli"
"github.com/photoprism/photoprism/internal/thumb"
"github.com/photoprism/photoprism/pkg/report"
)
// ShowThumbSizesCommand configures the command name, flags, and action.
var ShowThumbSizesCommand = cli.Command{
Name: "thumb-sizes",
Usage: "Displays supported standard thumbnail sizes",
Flags: report.CliFlags,
Action: showThumbSizesAction,
}
// showThumbSizesAction displays supported standard thumbnail sizes.
func showThumbSizesAction(ctx *cli.Context) error {
rows, cols := thumb.Report(thumb.Sizes.All(), false)
result, err := report.RenderFormat(rows, cols, report.CliFormat(ctx))
fmt.Println(result)
return err
}