diff --git a/plug-ins/common/file-png.c b/plug-ins/common/file-png.c index 042be81..effa58f 100644 --- a/plug-ins/common/file-png.c +++ b/plug-ins/common/file-png.c @@ -1400,6 +1400,31 @@ save_image (const gchar *filename, width = gegl_buffer_get_width (buffer); height = gegl_buffer_get_height (buffer); type = gimp_drawable_type (drawable_ID); + gegl_buffer_save (buffer, "/tmp/fump.buf", NULL); + + { + int Image; + int Layer; + GeglBuffer *buf2; + + Image = gimp_image_new_with_precision (width, + height, + type, + have_u16 ? + GIMP_PRECISION_U16 : + GIMP_PRECISION_U8); + Layer = gimp_layer_new (Image, _("Background"), + width, + height, + type, 100, GIMP_NORMAL_MODE); + gimp_image_insert_layer (Image, Layer, -1, 0); + buf2 = gimp_drawable_get_buffer (Layer); + gegl_buffer_copy (buffer, NULL, buf2, NULL); + g_object_unref (buf2); + + } + + gegl_buffer_save (buffer, "/tmp/fump2.buf", NULL); /* * Initialise remap[] @@ -1466,6 +1491,7 @@ save_image (const gchar *filename, pngvals.interlaced ? PNG_INTERLACE_ADAM7 : PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); + png_set_swap (pp); if (pngg.has_trns) { @@ -1621,7 +1647,6 @@ save_image (const gchar *filename, if (text) png_set_text (pp, info, text, 1); - // png_set_swap (pp); png_write_info (pp, info); /*