Coder Social home page Coder Social logo

canvas's People

Contributors

aboutofpluto avatar bbigras avatar gronpipmaster avatar jypelle avatar matm avatar terry-mao avatar xiam avatar yvasiyarov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

canvas's Issues

Mac Installation

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

Incorrect error handling in SetFormat

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.

Can't use SetBackgroundColor

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 imagesMagickWand-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).

Clang error on `go test`

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)

Some advice for improving performance

  • The New() method is too heavy, because many user don't want to handle with BackgroudColor or Drawing method, In other words, the Canvas api is not "raw" ( i get a thumbnail from image almost 0.5sec other than the 0.14 sec of python api)
  • The ImageMagick's NewPixelWand or NewDrawingWand must expose to the end user to control by themselves.
  • Many Newxxxx method must free memory

In my option
every raw method must exposed
buf for easy using Canvas we give a convenient API such as thumbnail, backgroundcolor .etc)

Bugs here : Thumbnail

    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 !

Delete or update go1 tag

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?

when call Write() get a SIGABRT randomly

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

Wrong rotation in AutoOrientate

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)

Speed improvements.

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.