Files
photoprism/internal/commands/show_thumb_sizes.go
Michael Mayer 44b94d0f62 Backend: Move report package to /pkg/txt/report
Signed-off-by: Michael Mayer <michael@photoprism.app>
2024-07-03 09:29:15 +02:00

31 lines
739 B
Go

package commands
import (
"fmt"
"github.com/urfave/cli"
"github.com/photoprism/photoprism/internal/thumb"
"github.com/photoprism/photoprism/pkg/txt/report"
)
// ShowThumbSizesCommand configures the command name, flags, and action.
var ShowThumbSizesCommand = cli.Command{
Name: "thumb-sizes",
Aliases: []string{"thumbs"},
Usage: "Displays supported thumbnail types and 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
}