Commit d86d0856 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

let the save procedure also accept a grayscale layer with alpha channel,

2008-12-26  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/file-gbr.c: let the save procedure also accept 
a
	grayscale layer with alpha channel, as we do in the GIH save
	procedure.

	* plug-ins/common/file-gih.c: when loading a brush mask pipe,
	create grayscale layers without an alpha channel. Changed the 
save
	procedure to also accept layers without alpha channel.


svn path=/trunk/; revision=27831
parent 6f9ccc51
2008-12-26 Sven Neumann <sven@gimp.org>
* plug-ins/common/file-gbr.c: let the save procedure accept a
grayscale layer with alpha channel, as we do in the GIH save
procedure.
* plug-ins/common/file-gih.c: when loading a brush mask pipe,
create grayscale layers without an alpha channel. Changed the save
procedure to also accept layers without alpha channel.
2008-12-25 Martin Nordholts <martinn@svn.gnome.org>
* app/widgets/gimplayertreeview.[ch]: Make instance members
......
......@@ -173,7 +173,7 @@ query (void)
"Tim Newsome, Jens Lautenbacher, Sven Neumann",
"1997-2000",
N_("GIMP brush"),
"RGB, RGBA, GRAY",
"RGB*, GRAY*",
GIMP_PLUGIN,
G_N_ELEMENTS (save_args), 0,
save_args, NULL);
......@@ -547,10 +547,12 @@ load_image (const gchar *filename,
base_type = GIMP_GRAY;
image_type = GIMP_GRAY_IMAGE;
break;
case 4:
base_type = GIMP_RGB;
image_type = GIMP_RGBA_IMAGE;
break;
default:
g_message ("Unsupported brush depth: %d\n"
"GIMP Brushes must be GRAY or RGBA\n",
......@@ -614,6 +616,7 @@ save_image (const gchar *filename,
break;
case GIMP_GRAY_IMAGE:
case GIMP_GRAYA_IMAGE:
bpp = 1;
break;
......@@ -679,6 +682,12 @@ save_image (const gchar *filename,
buffer[x] = 255 - buffer[x];
break;
case 2:
/* invert and drop alpha channel */
for (x = 0; x < drawable->width; x++)
buffer[x] = 255 - buffer[2 * x];
break;
case 3:
/* add alpha channel */
for (x = drawable->width - 1; x >= 0; x--)
......@@ -702,6 +711,9 @@ save_image (const gchar *filename,
}
g_free (buffer);
gimp_drawable_detach (drawable);
close (fd);
return TRUE;
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment