[gimp/metadata-wip-rebased: 4/9] plug-ins: create the jpeg comment parasite before saving metadata
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/metadata-wip-rebased: 4/9] plug-ins: create the jpeg comment parasite before saving metadata
- Date: Tue, 22 Oct 2013 20:51:21 +0000 (UTC)
commit 3f32b10dad0a66456ad8cdb365f46ee0def190ae
Author: Michael Natterer <mitch gimp org>
Date: Tue Oct 22 19:22:07 2013 +0200
plug-ins: create the jpeg comment parasite before saving metadata
plug-ins/file-jpeg/jpeg.c | 43 ++++++++++++++++++++++---------------------
1 files changed, 22 insertions(+), 21 deletions(-)
---
diff --git a/plug-ins/file-jpeg/jpeg.c b/plug-ins/file-jpeg/jpeg.c
index fd3543c..94e8a1e 100644
--- a/plug-ins/file-jpeg/jpeg.c
+++ b/plug-ins/file-jpeg/jpeg.c
@@ -489,6 +489,28 @@ run (const gchar *name,
{
GimpMetadata *metadata;
+ /* pw - now we need to change the defaults to be whatever
+ * was used to save this image. Dump the old parasites
+ * and add new ones.
+ */
+
+ gimp_image_detach_parasite (orig_image_ID, "gimp-comment");
+ if (image_comment && strlen (image_comment))
+ {
+ parasite = gimp_parasite_new ("gimp-comment",
+ GIMP_PARASITE_PERSISTENT,
+ strlen (image_comment) + 1,
+ image_comment);
+ gimp_image_attach_parasite (orig_image_ID, parasite);
+ gimp_parasite_free (parasite);
+ }
+
+ parasite = gimp_parasite_new ("jpeg-save-options",
+ 0, sizeof (jsvals), &jsvals);
+ gimp_image_attach_parasite (orig_image_ID, parasite);
+ gimp_parasite_free (parasite);
+
+ /* write metadata */
metadata = gimp_image_metadata_save_prepare (image_ID,
"image/jpeg");
@@ -513,27 +535,6 @@ run (const gchar *name,
g_object_unref (metadata);
}
-
- /* pw - now we need to change the defaults to be whatever
- * was used to save this image. Dump the old parasites
- * and add new ones.
- */
-
- gimp_image_detach_parasite (orig_image_ID, "gimp-comment");
- if (image_comment && strlen (image_comment))
- {
- parasite = gimp_parasite_new ("gimp-comment",
- GIMP_PARASITE_PERSISTENT,
- strlen (image_comment) + 1,
- image_comment);
- gimp_image_attach_parasite (orig_image_ID, parasite);
- gimp_parasite_free (parasite);
- }
-
- parasite = gimp_parasite_new ("jpeg-save-options",
- 0, sizeof (jsvals), &jsvals);
- gimp_image_attach_parasite (orig_image_ID, parasite);
- gimp_parasite_free (parasite);
}
}
else
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]