[gimp/gimp-2-10] app, plug-ins: make sure a GIH brush's spacing is preserved
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-10] app, plug-ins: make sure a GIH brush's spacing is preserved
- Date: Mon, 27 May 2019 22:29:10 +0000 (UTC)
commit 54a383685ecb8d16caac9ca64e63bd2730f855ef
Author: Michael Natterer <mitch gimp org>
Date: Tue May 28 00:25:47 2019 +0200
app, plug-ins: make sure a GIH brush's spacing is preserved
across load and save, by introducing a gimp-brush-pipe-spacing
parasite.
(cherry picked from commit 0710051e2b822370e77169417867ef73f76335c4)
app/file-data/file-data-gih.c | 10 ++++++++++
plug-ins/common/file-gih.c | 18 ++++++++++++++++++
2 files changed, 28 insertions(+)
---
diff --git a/app/file-data/file-data-gih.c b/app/file-data/file-data-gih.c
index 9d3ad1ce17..01e1592ea1 100644
--- a/app/file-data/file-data-gih.c
+++ b/app/file-data/file-data-gih.c
@@ -171,6 +171,7 @@ file_gih_pipe_to_image (Gimp *gimp,
const gchar *name;
GimpImageBaseType base_type;
GimpParasite *parasite;
+ gchar spacing[8];
gint i;
if (gimp_brush_get_pixmap (pipe->current))
@@ -189,6 +190,15 @@ file_gih_pipe_to_image (Gimp *gimp,
gimp_image_parasite_attach (image, parasite);
gimp_parasite_free (parasite);
+ g_snprintf (spacing, sizeof (spacing), "%d",
+ gimp_brush_get_spacing (GIMP_BRUSH (pipe)));
+
+ parasite = gimp_parasite_new ("gimp-brush-pipe-spacing",
+ GIMP_PARASITE_PERSISTENT,
+ strlen (spacing) + 1, spacing);
+ gimp_image_parasite_attach (image, parasite);
+ gimp_parasite_free (parasite);
+
for (i = 0; i < pipe->n_brushes; i++)
{
GimpLayer *layer;
diff --git a/plug-ins/common/file-gih.c b/plug-ins/common/file-gih.c
index 244ee5d295..bf63669db8 100644
--- a/plug-ins/common/file-gih.c
+++ b/plug-ins/common/file-gih.c
@@ -256,6 +256,14 @@ run (const gchar *name,
g_free (name);
}
+
+ parasite = gimp_image_get_parasite (orig_image_ID,
+ "gimp-brush-pipe-spacing");
+ if (parasite)
+ {
+ info.spacing = atoi (gimp_parasite_data (parasite));
+ gimp_parasite_free (parasite);
+ }
break;
default:
@@ -344,6 +352,7 @@ run (const gchar *name,
{
GimpParam *save_retvals;
gint n_save_retvals;
+ gchar spacing[8];
gchar *paramstring;
paramstring = gimp_pixpipe_params_build (&gihparams);
@@ -372,6 +381,15 @@ run (const gchar *name,
gimp_image_attach_parasite (orig_image_ID, parasite);
gimp_parasite_free (parasite);
+ g_snprintf (spacing, sizeof (spacing), "%d",
+ info.spacing);
+
+ parasite = gimp_parasite_new ("gimp-brush-pipe-spacing",
+ GIMP_PARASITE_PERSISTENT,
+ strlen (spacing) + 1, spacing);
+ gimp_image_attach_parasite (orig_image_ID, parasite);
+ gimp_parasite_free (parasite);
+
parasite = gimp_parasite_new ("gimp-brush-pipe-parameters",
GIMP_PARASITE_PERSISTENT,
strlen (paramstring) + 1,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]