sandboxed-api/oss-internship-2020/libpng
Wiktor Garbacz 36e4b80f9a Introduce and prefer AllowMmapWithoutExec
PiperOrigin-RevId: 593968486
Change-Id: I4f7d4d8a6f593d94c0a7e7672826074c4cefc230
2023-12-27 02:51:13 -08:00
..
examples #Cleanup: Consistently use char* argv[] instead of char** 2022-04-27 00:43:51 -07:00
images init libpng 2020-10-28 15:40:57 +00:00
tests Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
wrapper Change license link to HTTPS URL 2022-01-28 01:39:09 -08:00
CMakeLists.txt cmake: Rename build options to follow Abseil naming 2022-04-21 01:17:39 -07:00
README.md cmake: Rename build options to follow Abseil naming 2022-04-21 01:17:39 -07:00
sandboxed.h Introduce and prefer AllowMmapWithoutExec 2023-12-27 02:51:13 -08:00

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 .