[gimp] plug-ins: show descriptive layer type name for psp layers we can't convert.



commit 84f06e976a79795d5bb707d1ef8248a7c0562e2d
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.

 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 9080f0d657..efb546eef6 100644
--- a/plug-ins/common/file-psp.c
+++ b/plug-ins/common/file-psp.c
@@ -1315,6 +1315,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)
 {
@@ -1692,7 +1717,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]