#image #webp #libwebp #linker

sys no-std libwebp-sys2

A handwritten raw interface to libwebp

13 releases

Uses new Rust 2024

0.2.0 Feb 22, 2025
0.1.11 Feb 22, 2025
0.1.10 Dec 21, 2024
0.1.9 Sep 14, 2023
0.1.1 Mar 1, 2020

#123 in Images

Download history 2764/week @ 2024-12-05 2558/week @ 2024-12-12 2308/week @ 2024-12-19 1789/week @ 2024-12-26 2942/week @ 2025-01-02 3063/week @ 2025-01-09 2579/week @ 2025-01-16 2728/week @ 2025-01-23 2539/week @ 2025-01-30 2494/week @ 2025-02-06 2883/week @ 2025-02-13 3148/week @ 2025-02-20 1883/week @ 2025-02-27 2162/week @ 2025-03-06 2319/week @ 2025-03-13 1474/week @ 2025-03-20

8,280 downloads per month
Used in 22 crates (6 directly)

BSD-3-Clause

7.5MB
152K SLoC

C 142K SLoC // 0.1% comments Rust 3K SLoC // 0.0% comments C++ 2K SLoC // 0.2% comments Shell 2K SLoC // 0.2% comments Automake 1K SLoC // 0.0% comments Python 771 SLoC // 0.1% comments M4 335 SLoC // 0.4% comments Batch 151 SLoC Go 39 SLoC // 0.4% comments

Contains (JAR file, 59KB) c_src/gradle/wrapper/gradle-wrapper.jar, (obscure autoconf code, 30KB) c_src/configure.ac, (JAR file, 3KB) c_src/swig/libwebp.jar

libwebp-sys

This is a raw interface to the libwebp library.

Minimum Supported Rust Version (MSRV)

Rust 1.85.0

Features

  • std (default) ... enables std-dependent functions. This feature merely exists for future extension. Currently, you always need to set this feature.
  • demux ... enables libwebpdemux functions.
  • mux ... enables libwebpmux functions.
  • 0_5 (default) ... enables functions introduced in libwebp 0.5.0.
  • 0_6 (default) ... enables functions introduced in libwebp 0.6.0.
  • 1_1 (default) ... enables functions introduced in libwebp 1.1.0.
  • 1_2 (default) ... enables functions introduced in libwebp 1.2.0.
  • 1_4 ... enables functions introduced in libwebp 1.4.0.
  • 1_5 ... enables functions introduced in libwebp 1.5.0.
  • static ... statically link against the bundled libwebp.
  • extern-types ... enables #![feature(extern_types)].

Linking

If libwebp is found in the system, it links against the library. Otherwise it builds and links against the bundled libwebp.

In these cases, static link is preferred:

  • For musl target.
  • When cross-compiling.
  • static feature is turned on.
  • LIBWEBP_SYS_STATIC environment variable is set to 1 when building.

Dependencies