app: don't use GimpImageType in gimp_image_new_from_template()
This commit is contained in:
@ -86,8 +86,8 @@ gimp_image_new_from_template (Gimp *gimp,
|
|||||||
{
|
{
|
||||||
GimpImage *image;
|
GimpImage *image;
|
||||||
GimpLayer *layer;
|
GimpLayer *layer;
|
||||||
GimpImageType type;
|
|
||||||
gint width, height;
|
gint width, height;
|
||||||
|
gboolean has_alpha;
|
||||||
const gchar *comment;
|
const gchar *comment;
|
||||||
|
|
||||||
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
||||||
@ -124,20 +124,13 @@ gimp_image_new_from_template (Gimp *gimp,
|
|||||||
width = gimp_image_get_width (image);
|
width = gimp_image_get_width (image);
|
||||||
height = gimp_image_get_height (image);
|
height = gimp_image_get_height (image);
|
||||||
|
|
||||||
switch (gimp_template_get_fill_type (template))
|
if (gimp_template_get_fill_type (template) == GIMP_TRANSPARENT_FILL)
|
||||||
{
|
has_alpha = TRUE;
|
||||||
case GIMP_TRANSPARENT_FILL:
|
else
|
||||||
type = ((gimp_template_get_image_type (template) == GIMP_RGB) ?
|
has_alpha = FALSE;
|
||||||
GIMP_RGBA_IMAGE : GIMP_GRAYA_IMAGE);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
type = ((gimp_template_get_image_type (template) == GIMP_RGB) ?
|
|
||||||
GIMP_RGB_IMAGE : GIMP_GRAY_IMAGE);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
layer = gimp_layer_new (image, width, height,
|
layer = gimp_layer_new (image, width, height,
|
||||||
gimp_image_get_format (image, type),
|
gimp_image_get_layer_format (image, has_alpha),
|
||||||
_("Background"),
|
_("Background"),
|
||||||
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
|
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user