image

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package image provides utilities for processing image files, including retrieving image dimensions and creating thumbnails.

Index

Constants

This section is empty.

Variables

View Source
var (
	Exts         = []string{"gif", "png", "jpg", "jpeg"}
	DefThumbSize = 150
	ThumbPrefix  = "thumb_"
)

Functions

func CreateThumb

func CreateThumb(thumbPxSize int, r io.Reader) (*bytes.Reader, error)

CreateThumb generates a thumbnail of the given image file with the specified maximum dimension. The thumbnail's width will be resized to `thumbPxSize` while maintaining the aspect ratio.

func GetDimensions

func GetDimensions(r io.Reader) (int, int, error)

GetDimensions returns the width and height of the image in the provided file. It returns an error if the image cannot be decoded.

Types

This section is empty.

Jump to

Keyboard shortcuts

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