Documentation ¶
Overview ¶
Image (de)coding and processing magic package.
Index ¶
- func ConvertGifToWebp(gifData *[]byte) (*[]byte, error)
- func CropToSquare(img *image.Image) *image.Image
- func DecodeImage(imgData *[]byte, extInput string) (*image.Image, string, error)
- func EncodeImage(img *image.Image, format string) (*[]byte, error)
- func FixOrientation(img *image.Image, imgBytes *[]byte) (*image.Image, error)
- func ProcessImageBytes(data *ImageProcessPayload) (*string, error)
- func ProcessPost(post *models.Post, postContent *string) (error, int)
- func ResizeImage(img *image.Image, targetWidth int) image.Image
- type ImageProcessPayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertGifToWebp ¶
https://github.com/sizeofint/webpanimation/blob/master/examples/gif-to-webp/main.go
func CropToSquare ¶
CropToSquare crops an image to a 1:1 aspect ratio (square)
func DecodeImage ¶
DecodeImage decodes a byte stream to an image
func EncodeImage ¶
EncodeImage encodes an image back to byte stream (JPEG or PNG)
func FixOrientation ¶
FixOrientation checks the EXIF orientation tag and corrects the image's orientation if necessary
func ProcessImageBytes ¶ added in v0.44.26
func ProcessImageBytes(data *ImageProcessPayload) (*string, error)
func ProcessPost ¶ added in v0.44.26
Types ¶
type ImageProcessPayload ¶ added in v0.44.26
Click to show internal directories.
Click to hide internal directories.