Giter Club home page Giter Club logo

gowebp's Introduction

Go Report Card libwebp Version codecov GoDoc

This library provides C bindings and an API for encoding Webp images using Google's libwebp.

It is based on go-webp, but this includes and builds the libwebp C source from a versioned Git subtree.

Update libwebp version

  1. Pull in the relevant libwebp version, e.g. ./pull-libwebp.sh v1.2.0
  2. Regenerate wrappers with go generate ./gen
  3. Update the libwebp version badge above.

Local development

Compiling C code isn' particulary fast; if you install libwebp on your PC you can link against that, useful during development.

On a Mac you may do something like:

brew install webp
go test ./libwebp -tags dev

gowebp's People

Contributors

artoria2e5 avatar bep avatar iborodikhin avatar lex0 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gowebp's Issues

Vendored libwebp is vulnerable to CVE-2023-4863

Hi!

This Go package vendors a version of libwebp which is vulnerable to CVE-2023-4863. Upstream released v1.3.2, but since you're still on the 1.2.x branch you might want to cherry-pick the fix from the 1.2.4 branch if it's easier than bumping to a new minor: https://github.com/webmproject/libwebp/tree/1.2.4 (webmproject/libwebp@8bacd63)

Once that's done could you tag a new version of this package so older versions can be marked as vulnerable?

Thank you!
Best,

Compile on FreeBSD

Any chance you (or someone) has the steps for getting this to build on FreeBSD? I'm not super versed on cgo side of Go. I did clone this package and I cloned in the libwebp_src files (v1.2.0 per the readme).

I tried the generate command from the readme and I get the below

2023/04/07 13:45:47 lstat /code/webp/gowebp/libwebp_src/sharpyuv: no such file or directory exit status 1 gen/main.go:1: running "go": exit status 1

If I just ignore that like if somehow it's unimportant step and I try run the tests I get the below.

go test ./libwebp
# github.com/bep/gowebp/libwebp.test
/home/bwmarrin/.go/root/pkg/tool/freebsd_amd64/link: running clang failed: exit status 1
ld: error: undefined symbol: log10
>>> referenced by frame_enc.c:555 (../../libwebp_src/src/enc/frame_enc.c:555)
>>>               /tmp/go-link-3667838680/000052.o:(VP8EncLoop)
>>> referenced by frame_enc.c:555 (../../libwebp_src/src/enc/frame_enc.c:555)
>>>               /tmp/go-link-3667838680/000052.o:(VP8EncTokenLoop)
>>> referenced by picture_psnr_enc.c:129 (../../libwebp_src/src/enc/picture_psnr_enc.c:129)
>>>               /tmp/go-link-3667838680/000077.o:(WebPPlaneDistortion)
>>> referenced 6 more times

ld: error: undefined symbol: log
>>> referenced by lossless_enc.c:376 (../../libwebp_src/src/dsp/lossless_enc.c:376)
>>>               /tmp/go-link-3667838680/000060.o:(FastLog2Slow_C)
>>> referenced by lossless_enc.c:351 (../../libwebp_src/src/dsp/lossless_enc.c:351)
>>>               /tmp/go-link-3667838680/000060.o:(FastSLog2Slow_C)
>>> referenced by picture_psnr_enc.c:123 (../../libwebp_src/src/enc/picture_psnr_enc.c:123)
>>>               /tmp/go-link-3667838680/000077.o:(WebPPlaneDistortion)
>>> referenced 1 more times

ld: error: undefined symbol: pow
>>> referenced by picture_csp_enc.c:201 (../../libwebp_src/src/enc/picture_csp_enc.c:201)
>>>               /tmp/go-link-3667838680/000075.o:(ImportYUVAFromRGBA)
>>> referenced by picture_csp_enc.c:100 (../../libwebp_src/src/enc/picture_csp_enc.c:100)
>>>               /tmp/go-link-3667838680/000075.o:(ImportYUVAFromRGBA)
>>> referenced by picture_csp_enc.c:100 (../../libwebp_src/src/enc/picture_csp_enc.c:100)
>>>               /tmp/go-link-3667838680/000075.o:(ImportYUVAFromRGBA)
>>> referenced 9 more times
clang: error: linker command failed with exit code 1 (use -v to see invocation)

FAIL    github.com/bep/gowebp/libwebp [build failed]
FAIL

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.