From 1ca556972e09e360782ee17c97fe73661ebd449f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Kautler?= Date: Mon, 21 Apr 2014 01:44:40 +0200 Subject: [PATCH] Bug 728633 - Improvements to the file-raw plugin. Allow non-interactive and last-vals call of raw image data export. --- plug-ins/common/file-raw-data.c | 35 +++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/plug-ins/common/file-raw-data.c b/plug-ins/common/file-raw-data.c index f52388c852..b0cd481f2f 100644 --- a/plug-ins/common/file-raw-data.c +++ b/plug-ins/common/file-raw-data.c @@ -453,11 +453,38 @@ run (const gchar *name, status = GIMP_PDB_CANCEL; break; - default: - /* we want to make sure we always do save-as for raw images - * to avoid confusion and data loss + case GIMP_RUN_NONINTERACTIVE: + /* + * Make sure all the arguments are there! */ - status = GIMP_PDB_CALLING_ERROR; + if (nparams != 5) + { + if (nparams != 7) + { + status = GIMP_PDB_CALLING_ERROR; + } + else + { + rawvals.image_type = param[5].data.d_int32; + rawvals.palette_type = param[6].data.d_int32; + + if (((rawvals.image_type != RAW_RGB) && (rawvals.image_type != RAW_PLANAR)) || + ((rawvals.palette_type != RAW_PALETTE_RGB) && (rawvals.palette_type != RAW_PALETTE_BGR))) + { + status = GIMP_PDB_CALLING_ERROR; + } + } + } + break; + + case GIMP_RUN_WITH_LAST_VALS: + /* + * Possibly retrieve data... + */ + gimp_get_data (SAVE_PROC, &rawvals); + break; + + default: break; }