imsz
|
Get image width and height reading as few bytes as possible.
This library provides C bindings for the imsz Rust library. (Rust reference)
See imsz.h for all provided functionality.
Build the static and dynamic C libraries by running cargo build
in the c
folder of the imsz project. (See also cargo build --release
, cargo build --target=i686-pc-windows-gnu
, cargo build --target=x86_64-pc-windows-gnu
, etc.)
Build and link an example dynamically:
Build and link an example pseudo-statically (POSIX GCC):
-DIMSZ_STATIC
is only really needed for MSVC.
Sadly this requires linking libraries that aren't actually used by imsz, but that are used be the Rust standard library.
Then why do this pseudo-statically? Because when creating an actual static library we get warnings about certain functions in glibc (getpwuid_r
and getaddrinfo
) that require at runtime the shared libraries from the glibc version used for static linking:
Build and link an example statically (Windows MinGW):
Or:
Again, there are libraries that aren't actually used by imsz, but only by the Rust standard library.