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 ProcessBytes(post *models.Post, postContent *string) (error, int)
- func ResizeImage(img *image.Image, targetWidth int) image.Image
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 ProcessBytes ¶ added in v0.42.9
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
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.