[gimp] plug-ins: do some basic tweaking on file-rawtherapee.
- From: Jehan Pagès <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] plug-ins: do some basic tweaking on file-rawtherapee.
- Date: Tue, 27 Jun 2017 19:31:51 +0000 (UTC)
commit 4772948087bec8b8b1a4e225560179274474d1f0
Author: Jehan <jehan girinstud io>
Date: Tue Jun 27 20:51:44 2017 +0200
plug-ins: do some basic tweaking on file-rawtherapee.
Fix a few compilation warnings, clean what needs to be, apply coding
style fixes, add a Makefile…
configure.ac | 1 +
plug-ins/Makefile.am | 1 +
plug-ins/file-rawtherapee/Makefile.am | 30 ++++++++++++++++++++++++++
plug-ins/file-rawtherapee/file-formats.h | 3 --
plug-ins/file-rawtherapee/file-rawtherapee.c | 27 ++++++++++-------------
5 files changed, 44 insertions(+), 18 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 6c0028c..e09add3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2523,6 +2523,7 @@ plug-ins/file-fli/Makefile
plug-ins/file-ico/Makefile
plug-ins/file-jpeg/Makefile
plug-ins/file-psd/Makefile
+plug-ins/file-rawtherapee/Makefile
plug-ins/file-sgi/Makefile
plug-ins/file-tiff/Makefile
plug-ins/file-webp/Makefile
diff --git a/plug-ins/Makefile.am b/plug-ins/Makefile.am
index d60046c..da45da2 100644
--- a/plug-ins/Makefile.am
+++ b/plug-ins/Makefile.am
@@ -41,6 +41,7 @@ SUBDIRS = \
file-ico \
file-jpeg \
file-psd \
+ file-rawtherapee \
file-sgi \
file-tiff \
$(file_webp) \
diff --git a/plug-ins/file-rawtherapee/Makefile.am b/plug-ins/file-rawtherapee/Makefile.am
new file mode 100644
index 0000000..3f4a09a
--- /dev/null
+++ b/plug-ins/file-rawtherapee/Makefile.am
@@ -0,0 +1,30 @@
+## Process this file with automake to produce Makefile.in
+
+libgimp = $(top_builddir)/libgimp/libgimp-$(GIMP_API_VERSION).la
+libgimpbase = $(top_builddir)/libgimpbase/libgimpbase-$(GIMP_API_VERSION).la
+
+filerawtherapeedatadir = $(gimpdatadir)/file-rawtherapee
+
+if OS_WIN32
+mwindows = -mwindows
+endif
+
+AM_LDFLAGS = $(mwindows)
+
+libexecdir = $(gimpplugindir)/plug-ins
+
+AM_CPPFLAGS = \
+ -I$(top_srcdir) \
+ -I$(includedir) \
+ $(GTK_CFLAGS) \
+ $(GEGL_CFLAGS)
+
+libexec_PROGRAMS = file-rawtherapee
+
+file_rawtherapee_SOURCES = \
+ file-rawtherapee.c \
+ file-formats.h
+
+file_rawtherapee_LDADD = \
+ $(libgimp) \
+ $(libgimpbase)
diff --git a/plug-ins/file-rawtherapee/file-formats.h b/plug-ins/file-rawtherapee/file-formats.h
index b967c7c..fc6697e 100644
--- a/plug-ins/file-rawtherapee/file-formats.h
+++ b/plug-ins/file-rawtherapee/file-formats.h
@@ -35,9 +35,6 @@ struct _FileFormat
const gchar *load_help;
};
-#define N_(s) s
-#define _(s) s
-
static const FileFormat file_formats[] =
{
{
diff --git a/plug-ins/file-rawtherapee/file-rawtherapee.c b/plug-ins/file-rawtherapee/file-rawtherapee.c
index 92ce40f..995dfe0 100644
--- a/plug-ins/file-rawtherapee/file-rawtherapee.c
+++ b/plug-ins/file-rawtherapee/file-rawtherapee.c
@@ -20,18 +20,17 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-//#include "config.h"
+#include "config.h"
#include <stdlib.h>
#include <errno.h>
-#include <string.h>
#include <glib/gstdio.h>
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
-//#include "libgimp/stdplugins-intl.h"
+#include "libgimp/stdplugins-intl.h"
#include "file-formats.h"
@@ -117,7 +116,7 @@ query (void)
&rtversion) == 1)
{
have_rawtherapee = TRUE;
- free(rtversion);
+ free (rtversion);
}
g_free (rawtherapee_stdout);
@@ -182,7 +181,7 @@ run (const gchar *name,
GError *error = NULL;
gint i;
-// INIT_I18N ();
+ INIT_I18N ();
run_mode = param[0].data.d_int32;
@@ -278,7 +277,7 @@ load_image (const gchar *filename,
if (g_spawn_sync (NULL,
argv,
NULL,
-// G_SPAWN_STDOUT_TO_DEV_NULL |
+ /*G_SPAWN_STDOUT_TO_DEV_NULL |*/
G_SPAWN_STDERR_TO_DEV_NULL |
G_SPAWN_SEARCH_PATH,
NULL,
@@ -293,8 +292,8 @@ load_image (const gchar *filename,
gimp_image_set_filename (image_ID, filename);
}
-// if (rawtherapee_stdout) printf ("%s\n", rawtherapee_stdout);
- g_free(rawtherapee_stdout);
+ /*if (rawtherapee_stdout) printf ("%s\n", rawtherapee_stdout);*/
+ g_free (rawtherapee_stdout);
g_unlink (filename_out);
g_free (filename_out);
@@ -312,9 +311,7 @@ load_thumbnail_image (const gchar *filename,
gint32 image_ID = -1;
gchar *filename_out = gimp_temp_name ("jpg");
gchar *thumb_pp3 = gimp_temp_name ("pp3");
- gchar *size = g_strdup_printf ("%d", thumb_size);
- FILE *thumb_pp3_f = fopen(thumb_pp3, "w");
- gboolean pp3_ok = FALSE;
+ FILE *thumb_pp3_f = fopen (thumb_pp3, "w");
gchar *rawtherapee_stdout = NULL;
const char *pp3_content =
"[Version]\n"
@@ -360,7 +357,7 @@ load_thumbnail_image (const gchar *filename,
"\n"
"[RAW X-Trans]\n"
"Method=fast\n";
-
+
gchar *argv[] =
{
@@ -376,8 +373,8 @@ load_thumbnail_image (const gchar *filename,
};
if (thumb_pp3_f) {
- if (fprintf(thumb_pp3_f, pp3_content, thumb_size, thumb_size) < 0) {
- fclose(thumb_pp3_f);
+ if (fprintf (thumb_pp3_f, pp3_content, thumb_size, thumb_size) < 0) {
+ fclose (thumb_pp3_f);
thumb_pp3_f = NULL;
}
}
@@ -413,7 +410,7 @@ load_thumbnail_image (const gchar *filename,
gimp_progress_update (1.0);
if (thumb_pp3_f) {
- fclose(thumb_pp3_f);
+ fclose (thumb_pp3_f);
}
g_unlink (thumb_pp3);
g_free (filename_out);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]