png_get_text

Name

png_get_text -- get comments information from png_info structure

Synopsis

#include <png.h>

png_uint_32 png_get_text(png_structp png_ptr, png_infop info_ptr, png_textp * text_ptr, int * num_text);

Description

png_get_text() returns the text chunk information from the PNG stream in the array pointed to by text_ptr. It also returns the number of text chunks in num_text. text_ptr is an array of structure png_text whose members include:

compression 

type of compression used on text. Valid values are:

PNG_TEXT_COMPRESSION_NONE
PNG_TEXT_COMPRESSION_zTXt
PNG_ITXT_COMPRESSION_NONE
PNG_ITXT_COMPRESSION_zTXt

key 

keyword for comment. Must contain 1-79 characters.

text 

text comment for current keyword. May be empty.

text_length 

length of text string after decompression. 0 for iTXt.

Return Value

Returns 0 if png_ptr or info_ptr is NULL, returns the number of text chunks otherwise.