From f26bcf3294c0589ae42b08d72da91a2631efaca6 Mon Sep 17 00:00:00 2001 From: Oliver Hanraths Date: Tue, 21 May 2024 13:32:31 +0200 Subject: [PATCH 1/2] Add im7 core GetDelegates() and GetFeatures() --- imagick/magick_version.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/imagick/magick_version.go b/imagick/magick_version.go index 30fee02..2beba9f 100644 --- a/imagick/magick_version.go +++ b/imagick/magick_version.go @@ -5,11 +5,26 @@ package imagick /* +#include #include */ import "C" import "unsafe" +// Returns the ImageMagick delegates as a string constant. +func GetDelegates() (delegates string) { + csdelegates := C.GetMagickDelegates() + + return C.GoString(csdelegates) +} + +// Returns the ImageMagick features as a string constant. +func GetFeatures() (features string) { + csfeatures := C.GetMagickFeatures() + + return C.GoString(csfeatures) +} + // Returns the ImageMagick API copyright as a string constant. func GetCopyright() string { cstr := C.MagickGetCopyright() From fd4f327d4c1494108e19bc54b7c3f7680ed09d74 Mon Sep 17 00:00:00 2001 From: Oliver Hanraths Date: Wed, 22 May 2024 09:42:23 +0200 Subject: [PATCH 2/2] fixup! Add im7 core GetDelegates() and GetFeatures() --- imagick/magick_version.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/imagick/magick_version.go b/imagick/magick_version.go index 2beba9f..94f3e4b 100644 --- a/imagick/magick_version.go +++ b/imagick/magick_version.go @@ -12,17 +12,15 @@ import "C" import "unsafe" // Returns the ImageMagick delegates as a string constant. -func GetDelegates() (delegates string) { - csdelegates := C.GetMagickDelegates() - - return C.GoString(csdelegates) +func GetDelegates() string { + cstr := C.GetMagickDelegates() + return C.GoString(cstr) } // Returns the ImageMagick features as a string constant. -func GetFeatures() (features string) { - csfeatures := C.GetMagickFeatures() - - return C.GoString(csfeatures) +func GetFeatures() string { + cstr := C.GetMagickFeatures() + return C.GoString(cstr) } // Returns the ImageMagick API copyright as a string constant.