[Sng-devel] sng 1.0.5 vs libpng 1.4
Textualize a PNG image, or turn a textualized image back to a PNG.
Brought to you by:
esr
From: James C. <cl...@jh...> - 2011-06-14 07:06:13
|
I tried to compile sng from git. I have libpng-1.4.7 installed. First, notwithstanding the recent commits, I had to pass --with-rgbtxt=/usr/share/X11/rgb.txt to get ./configure to complete. That is fixed by: diff --git a/configure.in b/configure.in index b78df01..5dd6c4e 100644 --- a/configure.in +++ b/configure.in @@ -44,7 +44,7 @@ if test -n "$with_rgbtxt" then AC_DEFINE_UNQUOTED(RGBTXT, "$with_rgbtxt", [Location of X color database]) else - for dir in /etc/X11/ /usr/share/X11/rgb.txt /usr/X11R6/lib/X11 /usr/lib/X11 /usr/openwin/lib + for dir in /etc/X11/ /usr/share/X11/ /usr/X11R6/lib/X11 /usr/lib/X11 /usr/openwin/lib do if test -f ${dir}/rgb.txt then Second, sngd.c fails to compile with 166 deprication warnings (52 unique) and these errors: :; gcc -DHAVE_CONFIG_H -I. -g -MT sngd.o -MD -MP -MF .deps/sngd.Tpo -c -o sngd.o sngd.c 2>&1 |egrep -i error sngd.c:797:48: error: ‘png_info’ has no member named ‘trans_values’ sngd.c:801:15: error: ‘png_info’ has no member named ‘trans_values’ sngd.c:802:15: error: ‘png_info’ has no member named ‘trans_values’ sngd.c:803:15: error: ‘png_info’ has no member named ‘trans_values’ sngd.c:807:33: error: ‘png_info’ has no member named ‘trans’ After reading libpng(3), I see that this patch is required: diff --git a/sngd.c b/sngd.c index 248ac97..888d214 100644 --- a/sngd.c +++ b/sngd.c @@ -794,17 +794,17 @@ static void dump_tRNS(FILE *fpout) fprintf(fpout, "tRNS {\n"); switch (info_ptr->color_type) { case PNG_COLOR_TYPE_GRAY: - fprintf(fpout, " gray: %u;\n", info_ptr->trans_values.gray); + fprintf(fpout, " gray: %u;\n", info_ptr->trans_color.gray); break; case PNG_COLOR_TYPE_RGB: fprintf(fpout, " red: %u; green: %u; blue: %u;\n", - info_ptr->trans_values.red, - info_ptr->trans_values.green, - info_ptr->trans_values.blue); + info_ptr->trans_color.red, + info_ptr->trans_color.green, + info_ptr->trans_color.blue); break; case PNG_COLOR_TYPE_PALETTE: for (i = 0; i < info_ptr->num_trans; i++) - fprintf(fpout, " %u", info_ptr->trans[i]); + fprintf(fpout, " %u", info_ptr->trans_alpha[i]); break; case PNG_COLOR_TYPE_GRAY_ALPHA: case PNG_COLOR_TYPE_RGB_ALPHA: -JimC -- James Cloos <cl...@jh...> OpenPGP: 1024D/ED7DAEA6 |