+ res = save_image_file(img, fp);
+ fclose(fp);
+ return res;
+}
+
+int save_image_file(struct image *img, FILE *fp)
+{
+ int i, chan_bits, coltype;
+ png_struct *png;
+ png_info *info;
+ png_text txt;
+ unsigned char **scanline = 0;
+ unsigned char *pptr;