[libpng16] Added png_set_itxt() (work in progress)

This commit is contained in:
Glenn Randers-Pehrson
2012-03-16 13:53:25 -05:00
parent d9d7a7e8f0
commit 31d66245ea
6 changed files with 88 additions and 1 deletions

View File

@@ -863,6 +863,13 @@ void write_png(char *file_name /* , ... other image information ... */)
*/
png_set_gAMA(png_ptr, info_ptr, gamma);
#if PNG_LIBPNG_VER >= 1.6.0
png_set_itxt(png_ptr, info_ptr, 0, 0, "Title", "Mona Lisa", NULL, NULL);
png_set_itxt(png_ptr, info_ptr, 0, 0, "Author", "Leonardo da Vinci", NULL,
NULL);
png_set_itxt(png_ptr, info_ptr, 3, 0, "Description", "<long text>", NULL,
NULL);
#else
/* Optionally write comments into the image */
{
png_text text_ptr[3];
@@ -896,6 +903,7 @@ void write_png(char *file_name /* , ... other image information ... */)
png_set_text(write_ptr, write_info_ptr, text_ptr, 3);
}
#endif
/* Other optional chunks like cHRM, bKGD, tRNS, tIME, oFFs, pHYs */