From c54b36d0bf75ade0e8b38015ae56d06b38a6408d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Aparicio?= Date: Wed, 1 Apr 2015 12:57:09 +0200 Subject: [PATCH 1/8] feat(docs): add API example --- README.md | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index eefc223..a9ac813 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,42 @@ # bimg -Go library for blazing fast image processing based on [libvips](https://github.com/jcupitt/libvips) +Go library for blazing fast image processing based on [libvips](https://github.com/jcupitt/libvips) using C bindings `Work in progress` +## Installation + +```bash +go get gopkg.in/h2non/bimg.v0 +``` + +Or get the lastest development version +```bash +go get github.com/h2non/bimg +``` + +## API + +```go +import ( + "fmt" + "os" + "gopkg.in/h2non/bimg" +) + +options := bimg.Options{ + Width: 800, + Height: 600, + Crop: true, + Quality: 95, +} + +newImage, err := bimg.Resize(image, options) +if err != nil { + fmt.Fprintln(os.Stderr, err) +} +``` + ## License MIT - Tomas Aparicio From c2e218f5e5df338d5a843dfb32281de194f02d6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Aparicio?= Date: Thu, 2 Apr 2015 15:03:06 +0200 Subject: [PATCH 2/8] refactor: vips.h --- vips.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vips.h b/vips.h index 9990c3d..8256df6 100644 --- a/vips.h +++ b/vips.h @@ -80,13 +80,13 @@ vips_rotate(VipsImage *in, VipsImage **buf, int angle) }; int -vips_embed_extend(VipsImage *in, VipsImage **out, int left, int top, int width, int height, int extend) +vips_embed_adapter(VipsImage *in, VipsImage **out, int left, int top, int width, int height, int extend) { return vips_embed(in, out, left, top, width, height, "extend", extend, NULL); }; int -vips_colourspace_0(VipsImage *in, VipsImage **out, VipsInterpretation space) +vips_colourspace_adapter(VipsImage *in, VipsImage **out, VipsInterpretation space) { return vips_colourspace(in, out, space, NULL); }; From 14af10e7089cef489a8dcdbf582e84e309275a33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Aparicio?= Date: Thu, 2 Apr 2015 15:04:58 +0200 Subject: [PATCH 3/8] feat(docs): add badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a9ac813..e4cad62 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# bimg +# bimg [![Build Status](https://travis-ci.org/h2non/bimg.png)](https://travis-ci.org/h2non/bimg) [![GitHub release](https://img.shields.io/github/tag/h2non/bimg.svg)]() [![GoDoc](https://godoc.org/github.com/h2non/bimg?status.png)](https://godoc.org/github.com/h2non/bimg) Go library for blazing fast image processing based on [libvips](https://github.com/jcupitt/libvips) using C bindings From bc835f7e79ebe10ba82d7e731ac9ea7757ccd541 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Aparicio?= Date: Fri, 3 Apr 2015 00:31:31 +0200 Subject: [PATCH 4/8] feat(#8): add type alias --- vips.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vips.go b/vips.go index b464e9a..95423a1 100644 --- a/vips.go +++ b/vips.go @@ -13,6 +13,8 @@ import ( "unsafe" ) +type vipsImage *C.struct__VipsImage + func init() { runtime.LockOSThread() defer runtime.UnlockOSThread() From 3b54102018ec58748c58ae686ea1808f0f49e570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Aparicio?= Date: Fri, 3 Apr 2015 00:33:20 +0200 Subject: [PATCH 5/8] feat(#9): add Travis support --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 17d0135..3d097ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,4 +4,6 @@ go: - 1.3 - 1.2 - release - - tip \ No newline at end of file + - tip +before_install: + - curl -s https://raw.githubusercontent.com/lovell/sharp/master/preinstall.sh | sudo bash - From f564c0c0727bce95b8d512a56a73f6b85ccb7bb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Aparicio?= Date: Fri, 3 Apr 2015 01:23:56 +0200 Subject: [PATCH 6/8] update travis.yaml --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3d097ea..aa82785 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,6 @@ language: go go: - 1.4 - 1.3 - - 1.2 - release - tip before_install: From 587a84af2ed15e103ffc3b822a56afb9bf6df3bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Aparicio?= Date: Fri, 3 Apr 2015 01:43:43 +0200 Subject: [PATCH 7/8] feat(docs): add Go version support --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index e4cad62..97adbbb 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,7 @@ Go library for blazing fast image processing based on [libvips](https://github.c go get gopkg.in/h2non/bimg.v0 ``` -Or get the lastest development version -```bash -go get github.com/h2non/bimg -``` +Only supports Go 1.3+ ## API From 1b67c470b42bfee4985350d2064721431c2e47e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Aparicio?= Date: Fri, 3 Apr 2015 01:44:04 +0200 Subject: [PATCH 8/8] refactor(docs): go version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 97adbbb..99c444e 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Go library for blazing fast image processing based on [libvips](https://github.c go get gopkg.in/h2non/bimg.v0 ``` -Only supports Go 1.3+ +Requires Go 1.3+ ## API