master
Tomas Aparicio 11 years ago
commit 885b315035

@ -2,6 +2,7 @@ language: go
go:
- 1.4
- 1.3
- 1.2
- release
- tip
- tip
before_install:
- curl -s https://raw.githubusercontent.com/lovell/sharp/master/preinstall.sh | sudo bash -

@ -1,9 +1,39 @@
# 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)
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
```
Requires Go 1.3+
## 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

@ -13,6 +13,8 @@ import (
"unsafe"
)
type vipsImage *C.struct__VipsImage
func init() {
runtime.LockOSThread()
defer runtime.UnlockOSThread()

@ -11,27 +11,12 @@ enum types {
MAGICK
};
/*
#define JPEG 0
#define WEBP "WEBP"
#define PNG "PNG"
#define TIFF "TIFF"
#define MAGICK "MAGICK"
#define UNKNOWN "UNKNOWN"
*/
int
vips_affine_interpolator(VipsImage *in, VipsImage **out, double a, double b, double c, double d, VipsInterpolate *interpolator)
{
return vips_affine(in, out, a, b, c, d, "interpolate", interpolator, NULL);
};
int
vips_jpegload_buffer_seq(void *buf, size_t len, VipsImage **out)
{
return vips_jpegload_buffer(buf, len, out, "access", VIPS_ACCESS_SEQUENTIAL, NULL);
};
VipsImage*
vips_image_buffer_seq(void *buf, size_t len)
{

Loading…
Cancel
Save