Documentation
¶
Index ¶
- func DownloadImage(link string, authority, prefix, name string) (image.Image, error)
- func OpenImage(path string) (image.Image, error)
- func PreserveImageHeightRatio(img image.Image, newWidth int) (height int)
- func ProgressBar(size int64, authority, prefix, action, name string) *progressbar.ProgressBar
- func SaveJpg(reader io.Reader, filename string) error
- type PreviewGenerator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadImage ¶
DownloadImage attempts to download an image and returns it with any fatal errors (if occured).
func PreserveImageHeightRatio ¶ added in v3.1.0
PreserveImageHeightRatio calculates the new height of an image, given the new width, while preserving the original height ratio.
func ProgressBar ¶
ProgressBar will return darkness style progress bar.
Types ¶
type PreviewGenerator ¶
type PreviewGenerator struct {
// contains filtered or unexported fields
}
PreviewGenerator is a struct that generates a preview image.
func InitPreviewGenerator ¶
func InitPreviewGenerator( TitleFont string, NameFont string, TimeFont string, Width int, Height int, BackgroundColor string, AvatarFile string, ) PreviewGenerator
InitPreviewGenerator initializes a PreviewGenerator.
func (PreviewGenerator) Close ¶
func (p PreviewGenerator) Close() error
Close removes the resized avatar file.
Click to show internal directories.
Click to hide internal directories.