thumb

package
v1.0.53 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 16 Imported by: 0

README

Generate Thumbnails of Images

Two services are provided. One is to generate a thumbnail and return that thumbnail. The second generates the thumbnail and returns the URL/Path to the image.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DbOn map[string]bool

Functions

func ConvertUrlToPath

func ConvertUrlToPath(fnUrl string) (fn string)

func GenThumbnail

func GenThumbnail(fns []string, width, height, owidth, oheight int, to string) error

func GetImageDimension

func GetImageDimension(imagePath string) (width int, height int)

GetImageDimension returns width, height of an immage - .png, .jpg, .gif

  • not working on .svg
  • not returning errors

Example:

h, w = GetHWFromImage ( ffile_name );

func ResetLogFile added in v1.0.40

func ResetLogFile(newFp *os.File)

func SetupThumbnail

func SetupThumbnail(router *gin.Engine, cfg *data.ThumbnailType, xcfg *data.BaseConfigType, dbF map[string]bool, f *os.File, lfp *zap.Logger)

func ThumbnailImage

func ThumbnailImage(c *gin.Context)

Returns a Thumbnail for an image

func ThumbnailURL

func ThumbnailURL(c *gin.Context)

Types

type ApiThumbInput

type ApiThumbInput struct {
	FnUrl string `json:"fn" form:"fn"`
	W     *int   `json:"w" form:"w"`
	H     *int   `json:"h" form:"h"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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