// Terminates the MagickWand environment
func Terminate() {
	if initialized {
		C.free(unsafe.Pointer(dumb))
		C.DestroyMagick()
		initialized = false
	}
}
Beispiel #2
0
func main() {
	// Some GraphicsMagick boilerplate
	C.InitializeMagick(nil)
	defer C.DestroyMagick()
	C.GetExceptionInfo(&exceptionInfo)
	imageInfo = C.CloneImageInfo(nil)
	defer C.DestroyExceptionInfo(&exceptionInfo)
	defer C.DestroyImageInfo(imageInfo)

	// main OMIT

	Show("./cgo/armed_gopher.jpg")

	img, err := Read("./cgo/armed_gopher.jpg")
	if err != nil {
		fmt.Println(err)
		return
	}

	if img, err = Resize(img, 200, 800); err != nil {
		fmt.Println("resize error:", err)
		return
	}

	if err = Save(img, "./cgo/resized_gopher.jpg"); err != nil {
		fmt.Println("save error:", err)
		return
	}

	Show("./cgo/resized_gopher.jpg")
}
Beispiel #3
0
func cleanup() {
	C.DestroyMagick()
}
func CloseMagick() {
	C.DestroyMagick()
}