[gimp/gimp-2-10] plug-ins: show descriptive layer type name for psp layers we can't convert.
- From: Jehan <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-10] plug-ins: show descriptive layer type name for psp layers we can't convert.
- Date: Sat, 12 Sep 2020 10:08:25 +0000 (UTC)
commit 256292d514180d58ec2a9cc0f8f28282d267ccca
Author: Jacob Boerema <jgboerema gmail com>
Date: Sun Sep 6 11:58:59 2020 -0400
plug-ins: show descriptive layer type name for psp layers we can't convert.
(cherry picked from commit 84f06e976a79795d5bb707d1ef8248a7c0562e2d)
plug-ins/common/file-psp.c | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
---
diff --git a/plug-ins/common/file-psp.c b/plug-ins/common/file-psp.c
index 8a87d21184..e3b853e89c 100644
--- a/plug-ins/common/file-psp.c
+++ b/plug-ins/common/file-psp.c
@@ -1165,6 +1165,31 @@ blend_mode_name (PSPBlendModes mode)
return err_name;
}
+static const gchar *
+layer_type_name (PSPLayerTypePSP6 type)
+{
+ static const gchar *layer_type_names[] =
+ {
+ "Undefined",
+ "Raster",
+ "Floating Raster Selection",
+ "Vector",
+ "Adjustment",
+ "Group",
+ "Mask",
+ "Art Media",
+ };
+ static gchar *err_name = NULL;
+
+ if (type >= 0 && type <= keGLTArtMedia)
+ return layer_type_names[type];
+
+ g_free (err_name);
+ err_name = g_strdup_printf ("unknown layer type %d", type);
+
+ return err_name;
+}
+
static const gchar *
bitmap_type_name (gint type)
{
@@ -1542,7 +1567,7 @@ read_layer_block (FILE *f,
default:
bitmap_count = 0;
channel_count = 0;
- g_message ("Unsupported layer type %d (%s)", type, layer_name);
+ g_message ("Unsupported layer type %s (%s)", layer_type_name(type), layer_name);
break;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]