imagekit

package
v0.0.0-...-9e9b37c Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fill

func Fill(imageBytes []byte, width, height int, maxBytes int, anchor imaging.Anchor) ([]byte, string, error)

Fill creates an image with the specified dimensions and fills it with the scaled source image. To achieve the correct aspect ratio without stretching, the source image will be cropped.

func Fit

func Fit(imageBytes []byte, width, height int, maxBytes int) ([]byte, string, error)

Fit scales down the image to fit in the bounding box

func FitRect

func FitRect(width, height int, maxWidth, maxHeight int) (newWidth, newHeight int)

FitRect scales the given dimensiosn to fit inside the maxWidth-maxHeight box.

func GetMimeType

func GetMimeType(imageFormat string) (string, error)

GetMimeType returns the mime type for the given image format cooresponding to registered image types from the image package.

func GetThumbnail

func GetThumbnail(imageBytes []byte, width, height int, maxBytes int) ([]byte, string, error)

GetThumbnail creates an image in the given size, trying to encode it to the given max bytes

func ParseDetails

func ParseDetails(imageBytes []byte) (string, int, int, error)

func ParseMimeType

func ParseMimeType(imageBytes []byte) (string, error)

func Resize

func Resize(imageBytes []byte, width, height int, maxBytes int) ([]byte, string, error)

Resize resizes the image to the specified size, trying to encode it to the given max bytes

Types

This section is empty.

Jump to

Keyboard shortcuts

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