Skip to content

Commit

Permalink
Merge pull request #22 from fabiomarini/master
Browse files Browse the repository at this point in the history
fix: Fixed compilation issue on MacOS
  • Loading branch information
lEx0 authored Feb 28, 2023
2 parents 0e9c884 + b0ab32c commit 630f42c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions decoder/decoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
package decoder

/*
#cgo LDFLAGS: -lwebp
#cgo linux LDFLAGS: -lwebp
#cgo darwin pkg-config: libwebp
#include <stdlib.h>
#include <webp/decode.h>
*/
Expand All @@ -32,7 +33,6 @@ import (
"fmt"
"image"
"io"
"io/ioutil"
"unsafe"

"github.com/kolesa-team/go-webp/utils"
Expand All @@ -51,7 +51,7 @@ type Decoder struct {
func NewDecoder(r io.Reader, options *Options) (d *Decoder, err error) {
var data []byte

if data, err = ioutil.ReadAll(r); err != nil {
if data, err = io.ReadAll(r); err != nil {
return nil, err
}

Expand Down
4 changes: 3 additions & 1 deletion encoder/encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
package encoder

/*
#cgo LDFLAGS: -lwebp
#cgo linux LDFLAGS: -lwebp
#cgo darwin pkg-config: libwebp
#include <stdlib.h>
#include <webp/encode.h>
static uint8_t* encodeNRBBA(WebPConfig* config, const uint8_t* rgba, int width, int height, int stride, size_t* output_size) {
Expand Down

0 comments on commit 630f42c

Please sign in to comment.