gosexy / canvas Goto Github PK
View Code? Open in Web Editor NEWImage manipulation library based on ImageMagick's MagickWand, for Go.
License: MIT License
Image manipulation library based on ImageMagick's MagickWand, for Go.
License: MIT License
I installed imagemagick via homebrew and then go get github.com/gosexy/canvas but I'm getting the error:
ld: library not found for -lMagickWand
My guess is imagemagic was updated and there is a name change issue, but I don't know how to address it.
Using: Version: ImageMagick 6.8.8-9
Seems to be a typo, should be == C.MagickFalse
. As a result SetFormat
reports error on success.
if C.MagickSetImageFormat(self.wand, cformat) != C.MagickFalse {
return fmt.Errorf("Coluld not set format : %s", self.Error())
}
(Also the typo in the error message)
Thanks.
I'm not sure if it's a bug since I don't know if I can use SetBackgroundColor with a color name but when I do SetBackgroundColor("black")
I get the error Could not set background color: wand contains no images
MagickWand-1' @ error/magick-image.c/MagickSetImageBackgroundColor/9584`.
I'm using e4678ba since the latest commit doesn't build with Go 1.4 (and 1.3).
Upon running go test
receiving error:
# github.com/gosexy/canvas
clang: error: argument unused during compilation: '-fopenmp'
FAIL github.com/gosexy/canvas [build failed]
Go 1.2
LLVM 5.1
ImageMagick 6.8.7-7 (via Homebrew)
In my option
every raw method must exposed
buf for easy using Canvas we give a convenient API such as thumbnail, backgroundcolor .etc)
err := self.Resize(uint(float64(self.Width())/ratio), uint(float64(self.Height())/ratio))
if err != nil {
return err
}
if self.Width == width but self.Height > heigth then ration = 1.0
self.Resize will no effects
but next Crop will cut image's height !
I can save to a file using Write()
but can I generate an image in a []byte variable?
I saw Blob()
but I have an error Could not get image blob
when using it.
It creates new wand and destroys the old one.
But self is passed by value, so after return canvas contains old (invalid now) wand.
Actually I don't see why we need new wand? Resize works ok for me.
hi gosexy!
i want to add MagickReadImageBlob in Canvas, can you add me as a batch commiter?
Every time I try to get or update canvas, go get
command is checking out at the go1 tag. As we are improving this library, we should delete or update the go1 tag at some point.
I think we can delete the tag for now because as it's only bindings for a C library, we're not using specific functions of a version of Go and it's better to have always the head of the repository. Also, we don't have any release or anything like that so it's only serving as kind of a stable tag (as it's the one we're checking out when getting the library) but we have the experimental branch for that.
Frankly, I don't really know how to manage that tag properly, I kind of just want to bump it as soon as I make a new commit and that's why I don't find it really useful for now.
Any opinion on that?
wand/magick-image.c:2746: MagickDrawImage: Assertion `wand->signature == 0xabacadabUL' failed.
SIGABRT: abort
PC=0x7fe7472f1425
goroutine 43 [syscall]:
github.com/gosexy/canvas._Cfunc_MagickDrawImage(0x7fe63363d8a0, 0x7fe633fc10a0)
github.com/gosexy/canvas/_obj/_cgo_defun.c:282 +0x2f
github.com/gosexy/canvas.Canvas.Update(0x7fe63363d8a0, 0x7fe633fbcea0, 0x7fe633fbdf20, 0x7fe633fc10a0, 0x7fe633fbefa0, ...)
github.com/gosexy/canvas/_obj/canvas.cgo1.go:772 +0x42
github.com/gosexy/canvas.Canvas.Write(0x7fe63363d8a0, 0x7fe633fbcea0, 0x7fe633fbdf20, 0x7fe633fc10a0, 0x7fe633fbefa0, ...)
github.com/gosexy/canvas/_obj/canvas.cgo1.go:474 +0x3f
You should replace
case RIGHT_TOP_ORIENTATION:
self.RotateCanvas(-math.Pi / 2)
case LEFT_BOTTOM_ORIENTATION:
self.RotateCanvas(math.Pi / 2)
With
case RIGHT_TOP_ORIENTATION:
self.RotateCanvas(math.Pi / 2)
case LEFT_BOTTOM_ORIENTATION:
self.RotateCanvas(-math.Pi / 2)
As Terry said in #6, we should create some benchmarks and improve the speed of most methods. This issue will keep track on speed bugs.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.