--- tuxpaint-0.9.21/src/tuxpaint.c.orig	2014-04-06 15:01:47.705587844 +0000
+++ tuxpaint-0.9.21/src/tuxpaint.c	2014-04-06 15:02:22.850246198 +0000
@@ -12898,13 +12898,7 @@
       {
 	png_init_io(png_ptr, fi);
 
-	info_ptr->width = surf->w;
-	info_ptr->height = surf->h;
-	info_ptr->bit_depth = 8;
-	info_ptr->color_type = PNG_COLOR_TYPE_RGB;
-	info_ptr->interlace_type = 1;
-	info_ptr->valid = 0;	/* will be updated by various png_set_FOO() functions */
-
+	png_set_IHDR(png_ptr, info_ptr, surf->w, surf->h, 8, PNG_COLOR_TYPE_RGB, 1, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
 	png_set_sRGB_gAMA_and_cHRM(png_ptr, info_ptr,
 				   PNG_sRGB_INTENT_PERCEPTUAL);
 
--- tuxpaint-0.9.21/Makefile.orig	2014-04-06 15:16:49.468030974 +0000
+++ tuxpaint-0.9.21/Makefile	2014-04-06 15:17:11.747818328 +0000
@@ -834,7 +834,7 @@
 	@echo "...Linking Tux Paint..."
 	$(CC) $(CFLAGS) $(DEBUG_FLAGS) $(SDL_CFLAGS) $(FRIBIDI_CFLAGS) $(DEFS) \
 		-o tuxpaint $^ \
-		$(SDL_LIBS) $(SVG_LIB) $(ARCH_LINKS)
+		$(SDL_LIBS) $(SVG_LIB) $(ARCH_LINKS) -lpng
 	@$(RSRC_CMD)
 	@$(MIMESET_CMD)
 
