util

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package util provides upload media helpers and image utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompressImageToWebP

func CompressImageToWebP(srcReader io.Reader, quality string) ([]byte, error)

CompressImageToWebP decodes an image from srcReader and encodes it into WebP format using the specified quality (low -> 60, medium -> 75, high -> 85).

func IsArchiveExtension

func IsArchiveExtension(ext string) bool

IsArchiveExtension reports whether ext is a common archive format.

func IsDocumentExtension

func IsDocumentExtension(ext string) bool

IsDocumentExtension reports whether ext is a common document format.

func IsImageExtension

func IsImageExtension(ext string) bool

IsImageExtension reports whether ext is a common image format.

func NormalizeImageQuality

func NormalizeImageQuality(quality string) string

NormalizeImageQuality normalizes the requested image quality query parameter.

func ValidateS3Key

func ValidateS3Key(key string) error

ValidateS3Key validates an S3 object key for safety.

Types

This section is empty.

Jump to

Keyboard shortcuts

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