[gimp/gimp-2-8] Bug 728633 - Improvements to the file-raw plugin
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-8] Bug 728633 - Improvements to the file-raw plugin
- Date: Tue, 22 Apr 2014 20:09:59 +0000 (UTC)
commit 8b62ab865be7311aa55e11759f184f54b4f50246
Author: Björn Kautler <Bjoern Kautler net>
Date: Thu Apr 17 03:21:26 2014 +0200
Bug 728633 - Improvements to the file-raw plugin
Export the image before saving as raw image data.
plug-ins/common/file-raw.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/plug-ins/common/file-raw.c b/plug-ins/common/file-raw.c
index 39a2f0a..c95077f 100644
--- a/plug-ins/common/file-raw.c
+++ b/plug-ins/common/file-raw.c
@@ -221,6 +221,7 @@ run (const gchar *name,
GError *error = NULL;
gint32 image_id;
gint32 drawable_id;
+ GimpExportReturn export = GIMP_EXPORT_CANCEL;
INIT_I18N ();
@@ -300,6 +301,20 @@ run (const gchar *name,
image_id = param[1].data.d_int32;
drawable_id = param[2].data.d_int32;
+ /* export the image */
+ export = gimp_export_image (&image_id, &drawable_id, NULL,
+ GIMP_EXPORT_CAN_HANDLE_RGB |
+ GIMP_EXPORT_CAN_HANDLE_GRAY |
+ GIMP_EXPORT_CAN_HANDLE_INDEXED |
+ GIMP_EXPORT_CAN_HANDLE_ALPHA);
+
+ if (export == GIMP_EXPORT_CANCEL)
+ {
+ *nreturn_vals = 1;
+ values[0].data.d_status = GIMP_PDB_CANCEL;
+ return;
+ }
+
if (run_mode == GIMP_RUN_INTERACTIVE)
{
gimp_get_data (SAVE_PROC, runtime);
@@ -327,6 +342,9 @@ run (const gchar *name,
status = save_image (param[3].data.d_string, image_id, drawable_id,
&error);
}
+
+ if (export == GIMP_EXPORT_EXPORT)
+ gimp_image_delete (image_id);
}
g_free (runtime);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]