sandboxed-api/oss-internship-2020/libpng/README.md
Christian Blichmann 839914d6dd cmake: Rename build options to follow Abseil naming
`BUILD_TESTING` is a CMake provided option and we should use similar naming,
just like how Abseil does it.

- `SAPI_ENABLE_TESTS` -> `SAPI_BUILD_TESTING`
- `SAPI_ENABLE_CONTRIB_TESTS` -> `SAPI_CONTRIB_BUILD_TESTING`
- `SAPI_ENABLE_EXAMPLES` -> `SAPI_BUILD_EXAMPLES`

Drive-by:
- Fix option name in GitHub action
PiperOrigin-RevId: 443305932
Change-Id: Ice2b42be1229a0f9ae7c2ceda9ce87187baf22c4
2022-04-21 01:17:39 -07:00

927 B

sandboxed LibPNG

Copyright 2020 Google LLC.

Start use

You should make sure the libtiff submodule is cloned.

git clone --recursive https://github.com/google/sandboxed-api

Usage

Build:

mkdir -p build && cd build
cmake .. -DSAPI_ROOT=/path/to/sapi_root
make -j8

Example:

You should add -DLIBPNG_SAPI_BUILD_EXAMPLES=ON to use the example.
run PNG to PNG:

./examples/pngtopng /absolute/path/to/input/image.png /absolute/path/to/output/image.png

run RGB to BGR:

./examples/rgbtobgr /absolute/path/to/input/image.png /absolute/path/to/output/image.png

Examples of input and output can be found in images.

PNG to PNG:
input: images/pngtest.png
output: images/pngtopng_pngtest.png

RGB to BGR:
input: images/red_ball.png
output: images/rgbtobgr_red_ball.png

Tests:

You should add -DLIBPNG_SAPI_BUILD_TESTING=ON to use tests and do:

cd tests
ctest .