[Rawstudio-commit] r2111 - in branches/rawstudio-plugins: . plugins plugins/meta-raf src
Anders Brander
anders at brander.dk
Thu Dec 25 06:52:46 CET 2008
Author: abrander
Date: 2008-12-25 06:52:46 +0100 (Thu, 25 Dec 2008)
New Revision: 2111
Added:
branches/rawstudio-plugins/plugins/meta-raf/
branches/rawstudio-plugins/plugins/meta-raf/Makefile.am
branches/rawstudio-plugins/plugins/meta-raf/raf-meta.c
Removed:
branches/rawstudio-plugins/src/raf-meta.c
branches/rawstudio-plugins/src/raf-meta.h
Modified:
branches/rawstudio-plugins/configure.in
branches/rawstudio-plugins/plugins/Makefile.am
branches/rawstudio-plugins/src/Makefile.am
Log:
Moved (unused) raf meta loader to plugin.
Modified: branches/rawstudio-plugins/configure.in
===================================================================
--- branches/rawstudio-plugins/configure.in 2008-12-25 05:42:40 UTC (rev 2110)
+++ branches/rawstudio-plugins/configure.in 2008-12-25 05:52:46 UTC (rev 2111)
@@ -77,6 +77,7 @@
plugins/dcrawloader/Makefile
plugins/meta-ciff/Makefile
plugins/meta-mrw/Makefile
+plugins/meta-raf/Makefile
plugins/meta-tiff/Makefile
plugins/meta-x3f/Makefile
src/Makefile
Modified: branches/rawstudio-plugins/plugins/Makefile.am
===================================================================
--- branches/rawstudio-plugins/plugins/Makefile.am 2008-12-25 05:42:40 UTC (rev 2110)
+++ branches/rawstudio-plugins/plugins/Makefile.am 2008-12-25 05:52:46 UTC (rev 2111)
@@ -2,6 +2,7 @@
dcrawloader \
meta-ciff \
meta-mrw \
+ meta-raf \
meta-tiff \
meta-x3f
Added: branches/rawstudio-plugins/plugins/meta-raf/Makefile.am
===================================================================
--- branches/rawstudio-plugins/plugins/meta-raf/Makefile.am (rev 0)
+++ branches/rawstudio-plugins/plugins/meta-raf/Makefile.am 2008-12-25 05:52:46 UTC (rev 2111)
@@ -0,0 +1,21 @@
+plugindir = $(libdir)/rawstudio/plugins
+
+AM_CFLAGS =\
+ -Wall\
+ -O4
+
+AM_CXXFLAGS = $(AM_CFLAGS)
+
+INCLUDES = \
+ -DPACKAGE_DATA_DIR=\""$(datadir)"\" \
+ -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
+ @PACKAGE_CFLAGS@ \
+ -I../../librawstudio/
+
+lib_LTLIBRARIES = raf_meta.la
+
+libdir = $(datadir)/rawstudio/plugins/
+
+raf_meta_la_LIBADD = @PACKAGE_LIBS@
+raf_meta_la_LDFLAGS = -module -avoid-version
+raf_meta_la_SOURCES = raf-meta.c
Copied: branches/rawstudio-plugins/plugins/meta-raf/raf-meta.c (from rev 2107, branches/rawstudio-plugins/src/raf-meta.c)
===================================================================
--- branches/rawstudio-plugins/plugins/meta-raf/raf-meta.c (rev 0)
+++ branches/rawstudio-plugins/plugins/meta-raf/raf-meta.c 2008-12-25 05:52:46 UTC (rev 2111)
@@ -0,0 +1,113 @@
+/*
+ * Copyright (C) 2006-2008 Anders Brander <anders at brander.dk> and
+ * Anders Kvist <akv at lnxbx.dk>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include <rawstudio.h>
+#include <gtk/gtk.h>
+#include <math.h>
+
+void
+rs_raf_load_meta(const gchar *filename, RSMetadata *meta)
+{
+ RAWFILE *rawfile;
+ guint directory;
+ guint directory_entries;
+ guint entry;
+ guint offset;
+ gushort tag, length;
+ gushort temp;
+
+ rawfile = raw_open_file(filename);
+
+ if (raw_strcmp(rawfile, 0, "FUJIFILM", 8))
+ {
+ raw_get_uint(rawfile, 84, &meta->preview_start);
+ raw_get_uint(rawfile, 88, &meta->preview_length);
+ raw_get_uint(rawfile, 92, &directory);
+
+ raw_get_uint(rawfile, directory, &directory_entries);
+
+ offset = directory+4;
+
+ if (directory_entries < 256)
+ {
+ for(entry=0;entry<directory_entries;entry++)
+ {
+ raw_get_ushort(rawfile, offset, &tag);
+ raw_get_ushort(rawfile, offset+2, &length);
+ switch(tag)
+ {
+ case 0x2ff0: /* White balance */
+ raw_get_ushort(rawfile, offset+4, &temp);
+ meta->cam_mul[G] = temp;
+ raw_get_ushort(rawfile, offset+6, &temp);
+ meta->cam_mul[R] = temp;
+ raw_get_ushort(rawfile, offset+8, &temp);
+ meta->cam_mul[G2] = temp;
+ raw_get_ushort(rawfile, offset+10, &temp);
+ meta->cam_mul[B] = temp;
+ rs_metadata_normalize_wb(meta);
+ break;
+ }
+ offset = offset + 4 + length;
+ }
+ }
+ rs_filetype_meta_load(".tif", meta, rawfile, meta->thumbnail_start+12);
+ }
+ raw_close_file(rawfile);
+}
+
+GdkPixbuf *
+rs_raf_load_thumb(const gchar *src)
+{
+ RAWFILE *rawfile;
+ GdkPixbuf *pixbuf = NULL;
+ guint start;
+ guint length;
+
+ rawfile = raw_open_file(src);
+ if (raw_strcmp(rawfile, 0, "FUJIFILM", 8))
+ {
+ raw_get_uint(rawfile, 84, &start);
+ raw_get_uint(rawfile, 88, &length);
+ pixbuf = raw_get_pixbuf(rawfile, start, length);
+ }
+
+ if (pixbuf)
+ {
+ GdkPixbuf *pixbuf2;
+ gint width = gdk_pixbuf_get_width(pixbuf);
+ gint height = gdk_pixbuf_get_height(pixbuf);
+ rs_constrain_to_bounding_box(128, 128, &width, &height);
+ pixbuf2 = gdk_pixbuf_scale_simple(pixbuf, width, height, GDK_INTERP_BILINEAR);
+
+ g_object_unref(pixbuf);
+ pixbuf = pixbuf2;
+
+ /* Apparently raf-files does not contain any information about rotation ?! */
+ }
+
+ raw_close_file(rawfile);
+
+ return pixbuf;
+}
+
+G_MODULE_EXPORT void
+rs_plugin_load(RSPlugin *plugin)
+{
+}
Property changes on: branches/rawstudio-plugins/plugins/meta-raf/raf-meta.c
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: branches/rawstudio-plugins/src/Makefile.am
===================================================================
--- branches/rawstudio-plugins/src/Makefile.am 2008-12-25 05:42:40 UTC (rev 2110)
+++ branches/rawstudio-plugins/src/Makefile.am 2008-12-25 05:52:46 UTC (rev 2111)
@@ -39,7 +39,6 @@
rs-cache.c rs-cache.h \
rs-batch.c rs-batch.h \
toolbox.c toolbox.h \
- raf-meta.c raf-meta.h \
rs-photo.c rs-photo.h \
rs-jpeg.c rs-jpeg.h \
rs-tiff.c rs-tiff.h \
Deleted: branches/rawstudio-plugins/src/raf-meta.c
===================================================================
--- branches/rawstudio-plugins/src/raf-meta.c 2008-12-25 05:42:40 UTC (rev 2110)
+++ branches/rawstudio-plugins/src/raf-meta.c 2008-12-25 05:52:46 UTC (rev 2111)
@@ -1,110 +0,0 @@
-/*
- * Copyright (C) 2006-2008 Anders Brander <anders at brander.dk> and
- * Anders Kvist <akv at lnxbx.dk>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include <rawstudio.h>
-#include <gtk/gtk.h>
-#include <math.h>
-#include "raf-meta.h"
-#include "application.h"
-
-void
-rs_raf_load_meta(const gchar *filename, RSMetadata *meta)
-{
- RAWFILE *rawfile;
- guint directory;
- guint directory_entries;
- guint entry;
- guint offset;
- gushort tag, length;
- gushort temp;
-
- rawfile = raw_open_file(filename);
-
- if (raw_strcmp(rawfile, 0, "FUJIFILM", 8))
- {
- raw_get_uint(rawfile, 84, &meta->preview_start);
- raw_get_uint(rawfile, 88, &meta->preview_length);
- raw_get_uint(rawfile, 92, &directory);
-
- raw_get_uint(rawfile, directory, &directory_entries);
-
- offset = directory+4;
-
- if (directory_entries < 256)
- {
- for(entry=0;entry<directory_entries;entry++)
- {
- raw_get_ushort(rawfile, offset, &tag);
- raw_get_ushort(rawfile, offset+2, &length);
- switch(tag)
- {
- case 0x2ff0: /* White balance */
- raw_get_ushort(rawfile, offset+4, &temp);
- meta->cam_mul[G] = temp;
- raw_get_ushort(rawfile, offset+6, &temp);
- meta->cam_mul[R] = temp;
- raw_get_ushort(rawfile, offset+8, &temp);
- meta->cam_mul[G2] = temp;
- raw_get_ushort(rawfile, offset+10, &temp);
- meta->cam_mul[B] = temp;
- rs_metadata_normalize_wb(meta);
- break;
- }
- offset = offset + 4 + length;
- }
- }
- rs_filetype_meta_load(".tif", meta, rawfile, meta->thumbnail_start+12);
- }
- raw_close_file(rawfile);
-}
-
-GdkPixbuf *
-rs_raf_load_thumb(const gchar *src)
-{
- RAWFILE *rawfile;
- GdkPixbuf *pixbuf = NULL;
- guint start;
- guint length;
-
- rawfile = raw_open_file(src);
- if (raw_strcmp(rawfile, 0, "FUJIFILM", 8))
- {
- raw_get_uint(rawfile, 84, &start);
- raw_get_uint(rawfile, 88, &length);
- pixbuf = raw_get_pixbuf(rawfile, start, length);
- }
-
- if (pixbuf)
- {
- GdkPixbuf *pixbuf2;
- gint width = gdk_pixbuf_get_width(pixbuf);
- gint height = gdk_pixbuf_get_height(pixbuf);
- rs_constrain_to_bounding_box(128, 128, &width, &height);
- pixbuf2 = gdk_pixbuf_scale_simple(pixbuf, width, height, GDK_INTERP_BILINEAR);
-
- g_object_unref(pixbuf);
- pixbuf = pixbuf2;
-
- /* Apparently raf-files does not contain any information about rotation ?! */
- }
-
- raw_close_file(rawfile);
-
- return pixbuf;
-}
Deleted: branches/rawstudio-plugins/src/raf-meta.h
===================================================================
--- branches/rawstudio-plugins/src/raf-meta.h 2008-12-25 05:42:40 UTC (rev 2110)
+++ branches/rawstudio-plugins/src/raf-meta.h 2008-12-25 05:52:46 UTC (rev 2111)
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2006-2008 Anders Brander <anders at brander.dk> and
- * Anders Kvist <akv at lnxbx.dk>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "application.h"
-
-extern void rs_raf_load_meta(const gchar *filename, RSMetadata *meta);
-extern GdkPixbuf *rs_raf_load_thumb(const gchar *src);
More information about the Rawstudio-commit
mailing list