image

package
v0.44.9 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Image (de)coding and processing magic package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CropToSquare

func CropToSquare(img *image.Image) *image.Image

CropToSquare crops an image to a 1:1 aspect ratio (square)

func DecodeImage

func DecodeImage(imgData *[]byte, extInput string) (*image.Image, string, error)

DecodeImage decodes a byte stream to an image

func EncodeImage

func EncodeImage(img *image.Image, format string) (*[]byte, error)

EncodeImage encodes an image back to byte stream (JPEG or PNG)

func FixOrientation

func FixOrientation(img *image.Image, imgBytes *[]byte) (*image.Image, error)

FixOrientation checks the EXIF orientation tag and corrects the image's orientation if necessary

func ProcessBytes added in v0.42.9

func ProcessBytes(post *models.Post, postContent *string) (error, int)

ProcessBytes takes pointer to a post with image data as []byte stream, and pointer to content string to return as a reference to the novel image

func ResizeImage

func ResizeImage(img *image.Image, targetWidth int) image.Image

ResizeImage resizes an image to a target width and height while maintaining aspect ratio

Types

This section is empty.

Jump to

Keyboard shortcuts

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