gowatermark

package module
v0.0.0-...-e1b140e Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: MIT Imports: 12 Imported by: 0

README

gowatermark

watermark powered with golang

go get github.com/13sai/gowatermark
package main

import (
	"fmt"
	"github.com/13sai/gowatermark"
)

func main() {
	wt := gowatermark.New()
	fileName := "go.jpeg"
	FontFile := "/System/Library/Fonts/STHeiti Medium.ttc" //字体路径
	font := gowatermark.Font{FontFile, 16, "sai0556"}
	err := wt.From(fileName).Font(font).Position(20, 20).RGBA(20, 20, 100, 255).To("gowt.jpeg").Do().Error()
	if err != nil {
		fmt.Println(err.Error())
	} else {
		fmt.Println("success")
	}
}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrGifBound     = errors.New("gif: image block is out of bounds")
	ErrExt          = errors.New("ext not be allowed")
	ErrPosition     = errors.New("check x or y ")
	ErrFontNotFound = errors.New("font file not found")
	ErrRGBA         = errors.New("rgba not set")
)

Functions

func New

func New() *watermark

Types

type Font

type Font struct {
	File    string
	Size    int
	Content string
}

Jump to

Keyboard shortcuts

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