Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: go

go:
- 1.7
- 1.20

addons:
apt:
Expand Down
23 changes: 0 additions & 23 deletions Godeps/Godeps.json

This file was deleted.

7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
all: test

deps:
@which godep > /dev/null || go get github.com/tools/godep
@export CGO_CFLAGS_ALLOW=-L.*; godep go install
@export CGO_CFLAGS_ALLOW=-L.*; go install

test: deps
@export CGO_CFLAGS_ALLOW=-L.*; go list ./... | grep -v /vendor/ | xargs -n1 godep go test
@export CGO_CFLAGS_ALLOW=-L.*; go list ./... | grep -v /vendor/ | xargs -n1 go test

bench: deps
@export CGO_CFLAGS_ALLOW=-L.*; go list ./... | grep -v /vendor/ | xargs -n1 godep go test -run=XXX -benchtime=1s -bench=.
@export CGO_CFLAGS_ALLOW=-L.*; go list ./... | grep -v /vendor/ | xargs -n1 go test -run=XXX -benchtime=1s -bench=.

.PNONY: all deps test
8 changes: 8 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module github.com/cotap/prism

go 1.19

require (
github.com/rwcarlsen/goexif v0.0.0-20150520140647-709fab3d192d
github.com/stretchr/testify v0.0.0-20150527144555-232e8563676c
)
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
github.com/rwcarlsen/goexif v0.0.0-20150520140647-709fab3d192d h1:0/OVHHIrQqGZxHRbrX3tJx95MkIbzV44KE66ZGkhH+0=
github.com/rwcarlsen/goexif v0.0.0-20150520140647-709fab3d192d/go.mod h1:hPqNNc0+uJM6H+SuU8sEs5K5IQeKccPqeSjfgcKGgPk=
github.com/stretchr/testify v0.0.0-20150527144555-232e8563676c h1:K56CZP/W9Pm5E3ypakxzGPHfgy+kH3qbGPl+2BZ3o60=
github.com/stretchr/testify v0.0.0-20150527144555-232e8563676c/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
4 changes: 3 additions & 1 deletion image.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@ func Decode(r io.Reader) (img *Image, err error) {
return
}

fmt.Printf("data: %v\n", unsafe.Pointer(&b[0]))
fmt.Printf("dataSize: %v\n", C.uint(len(b)))
iplImage := C.prismDecode(unsafe.Pointer(&b[0]), C.uint(len(b)))
if iplImage == nil {
err = errors.New("Unable to decode image")
err = errors.New("unable to decode image")
return
}

Expand Down
1 change: 1 addition & 0 deletions prism.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <prism.h>
#include <opencv2/imgcodecs/imgcodecs_c.h>

int isRecoverableError(char* errorStr) {
if (!strcmp(errorStr, "Invalid SOS parameters for sequential JPEG") ||
Expand Down
79 changes: 0 additions & 79 deletions vendor/github.com/rwcarlsen/goexif/exif/regen_regress.go

This file was deleted.

9 changes: 0 additions & 9 deletions vendor/github.com/stretchr/testify/LICENCE.txt

This file was deleted.

7 changes: 7 additions & 0 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# github.com/rwcarlsen/goexif v0.0.0-20150520140647-709fab3d192d
## explicit
github.com/rwcarlsen/goexif/exif
github.com/rwcarlsen/goexif/tiff
# github.com/stretchr/testify v0.0.0-20150527144555-232e8563676c
## explicit
github.com/stretchr/testify/assert