png_set_unknown_chunks

Name

png_set_unknown_chunks -- insert unknown chunks into a PNG file

Synopsis

#include <png.h>

void png_set_unknown_chunks(png_structp png_ptr, png_infop info_ptr, png_unknown_chunkp unknowns, int num_unknowns);

Description

This interface shall insert unknown chunks into a PNG file.

The parameter png_ptr shall specify the PNG file.

The parameter info_ptr shall specify the PNG info structure.

The parameter unknowns shall specify an array of png_unknown_chunk structures containing the unknown chunks, as described under png_get_unknown_chunks(). The location member of a png_unknown_chunk structure can take several special values (see below).

The parameter num_unknowns shall specify the number of unknown chunks.

The special values for the location members of the png_unknown_chunk structures are as follows.

0 

do not write the chunk

PNG_HAVE_IHDR 

insert chunk before PLTE

PNG_HAVE_PLTE 

insert chunk before IDAT

PNG_AFTER_IDAT 

insert chunk after IDAT

Notes

The location member of the png_unknown_chunk structure is set automatically depending on how much of the PNG file has been written. Its value can be changed after calling this interface. The chunk is placed within a location according to its position in the array of structures, as described under png_get_unknown_chunks().