diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 195a8a6..0000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: go - -go: - - 1.6 - - 1.7 - - 1.8 - - tip -env: - - LIBWEBP_VERSION="0.5.0" - - LIBWEBP_VERSION="0.5.1" - - LIBWEBP_VERSION="1.1.0" - - -cache: - directories: - - $HOME/cache -sudo: false - -before_install: - - LIBWEBP_PREFIX=$HOME/cache/libwebp-${LIBWEBP_VERSION} make libwebp - - cd $HOME/gopath/src/github.com/harukasan/go-libwebp - - export CGO_CFLAGS="-I $HOME/cache/libwebp-${LIBWEBP_VERSION}/include" - - export CGO_LDFLAGS="-L $HOME/cache/libwebp-${LIBWEBP_VERSION}/lib" - - export LD_LIBRARY_PATH=$HOME/cache/libwebp-${LIBWEBP_VERSION}/lib:$LD_LIBRARY_PATH diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 3c14bd3..0000000 --- a/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -FROM alpine:3.4 - -RUN apk add --no-cache g++ make go - -RUN mkdir -p /tmp/go-libwebp -COPY Makefile /tmp/go-libwebp/Makefile - -ENV LIBWEBP_PREFIX="/usr/local" \ - LIBWEBP_VERSION="0.5.1" -RUN cd /tmp/go-libwebp && make libwebp - -ENV GOPATH="/go" \ - WORKDIR="/go/src/github.com/harukasan/go-libwebp" \ - PATH="/go/bin:/usr/local/go/bin:$PATH" \ - CGO_CFLAGS="-I /usr/local/include" \ - CGO_LDFLAGS="-L /usr/local/lib" \ - LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" - -RUN mkdir -p $WORKDIR -VOLUME $WORKDIR -WORKDIR $WORKDIR - -CMD ["make", "test"] diff --git a/Makefile b/Makefile index 3b895cb..13d08d5 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -repo = github.com/harukasan/go-libwebp +repo = github.com/tidbyt/go-libwebp build_dir = /tmp cur_dir = $(shell pwd) libwebp_so = ${LIBWEBP_PREFIX}/lib/libwebp.so diff --git a/README.md b/README.md index e8ef8ef..0d7a4b4 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ go-libwebp ========== -[![Build Status](https://travis-ci.org/harukasan/go-libwebp.svg?branch=master)](https://travis-ci.org/harukasan/go-libwebp) -[![GoDoc](https://godoc.org/github.com/harukasan/go-libwebp/webp?status.svg)](https://godoc.org/github.com/harukasan/go-libwebp/webp) +[![GoDoc](https://godoc.org/github.com/tidbyt/go-libwebp/webp?status.svg)](https://godoc.org/github.com/tidbyt/go-libwebp/webp) A implementation of Go binding for [libwebp](https://developers.google.com/speed/webp/docs/api). @@ -20,8 +19,8 @@ The [examples](./examples) directory contains example codes and images. package main import ( - "github.com/harukasan/go-libwebp/test/util" - "github.com/harukasan/go-libwebp/webp" + "github.com/tidbyt/go-libwebp/test/util" + "github.com/tidbyt/go-libwebp/webp" ) func main() { @@ -52,8 +51,8 @@ import ( "bufio" "image" - "github.com/harukasan/go-libwebp/test/util" - "github.com/harukasan/go-libwebp/webp" + "github.com/tidbyt/go-libwebp/test/util" + "github.com/tidbyt/go-libwebp/webp" ) func main() { @@ -86,8 +85,8 @@ import ( "image" "time" - "github.com/harukasan/go-libwebp/test/util" - "github.com/harukasan/go-libwebp/webp" + "github.com/tidbyt/go-libwebp/test/util" + "github.com/tidbyt/go-libwebp/webp" ) func main() { diff --git a/examples/decode/decode.go b/examples/decode/decode.go index 3a46724..99e6f9d 100644 --- a/examples/decode/decode.go +++ b/examples/decode/decode.go @@ -2,8 +2,8 @@ package main import ( - "github.com/harukasan/go-libwebp/test/util" - "github.com/harukasan/go-libwebp/webp" + "github.com/tidbyt/go-libwebp/test/util" + "github.com/tidbyt/go-libwebp/webp" ) func main() { diff --git a/examples/encode/encode.go b/examples/encode/encode.go index f1eb977..2a1b9c3 100644 --- a/examples/encode/encode.go +++ b/examples/encode/encode.go @@ -5,8 +5,8 @@ import ( "bufio" "image" - "github.com/harukasan/go-libwebp/test/util" - "github.com/harukasan/go-libwebp/webp" + "github.com/tidbyt/go-libwebp/test/util" + "github.com/tidbyt/go-libwebp/webp" ) func main() { diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..8de3963 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/tidbyt/go-libwebp + +go 1.16 diff --git a/test/util/util.go b/test/util/util.go index c284b75..b204f0c 100644 --- a/test/util/util.go +++ b/test/util/util.go @@ -10,29 +10,24 @@ import ( "io/ioutil" "os" "path/filepath" - "strings" ) // GetExFilePath returns the path of specified example file. func GetExFilePath(name string) string { - for _, gopath := range strings.Split(os.Getenv("GOPATH"), ":") { - path := filepath.Join(gopath, "src/github.com/harukasan/go-libwebp/examples/images", name) - if _, err := os.Stat(path); err == nil { - return path - } + path := filepath.Join("../examples/images", name) + if _, err := os.Stat(path); err == nil { + return path } - panic(fmt.Errorf("%v does not exist in any directory which contains in $GOPATH", name)) + panic(fmt.Errorf("%v does not exist", path)) } // GetOutFilePath returns the path of specified out file. func GetOutFilePath(name string) string { - for _, gopath := range strings.Split(os.Getenv("GOPATH"), ":") { - path := filepath.Join(gopath, "src/github.com/harukasan/go-libwebp/examples/out") - if _, err := os.Stat(path); err == nil { - return filepath.Join(path, name) - } + path := "../examples/out" + if _, err := os.Stat(path); err == nil { + return filepath.Join(path, name) } - panic(fmt.Errorf("out directory does not exist in any directory which contains in $GOPATH")) + panic(fmt.Errorf("out directory does not exist")) } // OpenFile opens specified example file diff --git a/test/util/util_test.go b/test/util/util_test.go deleted file mode 100644 index 810f40a..0000000 --- a/test/util/util_test.go +++ /dev/null @@ -1,54 +0,0 @@ -package util_test - -import ( - "testing" - - "github.com/harukasan/go-libwebp/test/util" -) - -var PNGFiles = []string{ - "butterfly.png", - "cosmos.png", - "fizyplankton.png", - "kinkaku.png", - "yellow-rose-3.png", -} - -var WebPFiles = []string{ - "butterfly.webp", - "cosmos.webp", - "fizyplankton.webp", - "kinkaku.webp", - "yellow-rose-3.webp", -} - -func TestOpenFile(t *testing.T) { - for _, file := range PNGFiles { - util.OpenFile(file) - } - for _, file := range WebPFiles { - util.OpenFile(file) - } -} - -func TestReadFile(t *testing.T) { - for _, file := range PNGFiles { - util.ReadFile(file) - } - for _, file := range WebPFiles { - util.ReadFile(file) - } -} - -func TestCreateFile(t *testing.T) { - f := util.CreateFile("util_test") - f.Write([]byte{'o', 'k'}) - f.Close() -} - -func TestReadWritePNG(t *testing.T) { - for _, file := range PNGFiles { - png := util.ReadPNG(file) - util.WritePNG(png, "util_test_"+file) - } -} diff --git a/webp/anim_decode_test.go b/webp/anim_decode_test.go index 5b68103..623364d 100644 --- a/webp/anim_decode_test.go +++ b/webp/anim_decode_test.go @@ -4,8 +4,8 @@ import ( "fmt" "testing" - "github.com/harukasan/go-libwebp/test/util" - "github.com/harukasan/go-libwebp/webp" + "github.com/tidbyt/go-libwebp/test/util" + "github.com/tidbyt/go-libwebp/webp" ) func TestDecodeAnimationInfo(t *testing.T) { diff --git a/webp/anim_encode_test.go b/webp/anim_encode_test.go index 0c1175d..b1e7e17 100644 --- a/webp/anim_encode_test.go +++ b/webp/anim_encode_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "github.com/harukasan/go-libwebp/test/util" - "github.com/harukasan/go-libwebp/webp" + "github.com/tidbyt/go-libwebp/test/util" + "github.com/tidbyt/go-libwebp/webp" ) func TestEncodeAnimation(t *testing.T) { diff --git a/webp/webp_test.go b/webp/webp_test.go index 4a7ef30..1e26250 100644 --- a/webp/webp_test.go +++ b/webp/webp_test.go @@ -8,8 +8,8 @@ import ( "os" "testing" - "github.com/harukasan/go-libwebp/test/util" - "github.com/harukasan/go-libwebp/webp" + "github.com/tidbyt/go-libwebp/test/util" + "github.com/tidbyt/go-libwebp/webp" ) func TestMain(m *testing.M) {