--- work/gif2png-2.5.1/gif2png.c.orig 2006-07-07 16:40:33.000000000 -0400 +++ work/gif2png-2.5.1/gif2png.c 2006-07-07 16:43:25.000000000 -0400 @@ -135,7 +135,7 @@ unsigned long hist_maxvalue; int passcount; int errtype, errorcount = 0; - png_text software; + png_text comment, software; /* these volatile declarations prevent gcc warnings ("variable might be * clobbered by `longjmp' or `vfork'") */ @@ -517,10 +517,15 @@ j = s->size; if (j > 0 && data[j-1] == '\0') /* some apps include a NULL in GIF comment */ --j; - if (j<500) { - png_write_tEXt(png_ptr, "Comment", (png_charp)data, j); + if (j<1000) { + comment.compression = PNG_TEXT_COMPRESSION_NONE; } else { - png_write_zTXt(png_ptr, "Comment", (png_charp)data, j, 0); + comment.compression = PNG_TEXT_COMPRESSION_zTXt; + comment.key = "Comment"; + comment.text = data; + comment.text_length = j; + + png_set_text(png_ptr, info_ptr, &comment, 1); } break;