started exiv2 integration
authorVladimir Nadvornik <nadvornik@suse.cz>
Wed, 13 Feb 2008 14:46:23 +0000 (14:46 +0000)
committerVladimir Nadvornik <nadvornik@suse.cz>
Wed, 13 Feb 2008 14:46:23 +0000 (14:46 +0000)
13 files changed:
configure.in
src/Makefile.am
src/bar_exif.c
src/cache-loader.c
src/exif.c
src/exif.h
src/format_canon.c
src/format_fuji.c
src/format_nikon.c
src/format_olympus.c
src/format_raw.c
src/image.c
src/pan-view.c

index 9335493..7feb4f1 100644 (file)
@@ -7,6 +7,7 @@ AM_MAINTAINER_MODE
 
 AC_ISC_POSIX
 AC_PROG_CC
+AC_PROG_CXX
 AC_STDC_HEADERS
 AC_ARG_PROGRAM
 
@@ -49,6 +50,13 @@ else
   have_lcms="no (lcms support disabled)"
 fi
 
+
+PKG_CHECK_MODULES(EXIV2, exiv2 >= 0.11,
+  [ have_exiv2=yes
+    AC_DEFINE(HAVE_EXIV2, 1, have exiv2) ],
+  [ have_exiv2=no
+    AC_MSG_RESULT($EXIV2_PKG_ERRORS) ] )
+
 AC_SUBST(LCMS_LIBS)
 AM_CONDITIONAL(HAVE_LCMS, test "$have_lcms" = "yes")
 
index 7ce4702..dfa4f09 100644 (file)
@@ -84,6 +84,7 @@ gqview_SOURCES = \
        editors.h       \
        exif.c          \
        exif.h          \
+       exiv2.cc        \
        filelist.c      \
        filelist.h      \
        format_canon.c  \
index f25ef4b..24d1166 100644 (file)
@@ -172,7 +172,7 @@ static void bar_exif_update(ExifBar *eb)
        ExifData *exif;
        gint len, i;
 
-       exif = exif_read(eb->fd, FALSE);
+       exif = exif_read(eb->fd->path, FALSE);
 
        if (!exif)
                {
index f77a0aa..d0487c3 100644 (file)
@@ -125,7 +125,7 @@ static gboolean cache_loader_process(CacheLoader *cl)
                time_t date = -1;
                ExifData *exif;
 
-               exif = exif_read(cl->fd, FALSE);
+               exif = exif_read(cl->fd->path, FALSE);
                if (exif)
                        {
                        gchar *text;
index 908fcfb..97d3677 100644 (file)
@@ -54,6 +54,8 @@
 #  include "config.h"
 #endif
 
+#ifndef HAVE_EXIV2
+
 #include <stdio.h>
 #include <string.h>
 #include <fcntl.h>
@@ -1232,7 +1234,7 @@ void exif_free(ExifData *exif)
        g_free(exif);
 }
 
-ExifData *exif_read(FileData *fd, gint parse_color_profile)
+ExifData *exif_read(gchar *path, gint parse_color_profile)
 {
        ExifData *exif;
        void *f;
@@ -1241,7 +1243,7 @@ ExifData *exif_read(FileData *fd, gint parse_color_profile)
 
        if (!fd) return NULL;
 
-       pathl = path_from_utf8(fd->path);
+       pathl = path_from_utf8(path);
        if (map_file(pathl, &f, &size) == -1)
                {
                g_free(pathl);
@@ -1848,3 +1850,5 @@ void exif_write_data_list(ExifData *exif, FILE *f, gint human_readable_list)
        fprintf(f, "----------------------------------------------------\n");
 }
 
+#endif 
+/* not HAVE_EXIV2 */
index c2c07d7..17f80f0 100644 (file)
@@ -97,7 +97,7 @@ typedef enum {
  *-----------------------------------------------------------------------------
  */
 
-ExifData *exif_read(FileData *fd, gint parse_color_profile);
+ExifData *exif_read(gchar *path, gint parse_color_profile);
 void exif_free(ExifData *exif);
 
 gchar *exif_get_data_as_text(ExifData *exif, const gchar *key);
index 68b35d4..f4e0646 100644 (file)
@@ -19,6 +19,7 @@
 #  include "config.h"
 #endif
 
+#ifndef HAVE_EXIV2
 
 #include <stdio.h>
 #include <string.h>
@@ -629,3 +630,5 @@ gint format_canon_makernote(ExifData *exif, unsigned char *tiff, guint offset,
 }
 
 
+#endif 
+/* not HAVE_EXIV2 */
index de423ab..995a1c8 100644 (file)
@@ -14,6 +14,7 @@
 #  include "config.h"
 #endif
 
+#ifndef HAVE_EXIV2
 
 #include <stdio.h>
 #include <string.h>
@@ -201,3 +202,5 @@ gint format_fuji_makernote(ExifData *exif, unsigned char *tiff, guint offset,
        return TRUE;
 }
 
+#endif 
+/* not HAVE_EXIV2 */
index 5d6dedf..2af0e57 100644 (file)
@@ -15,6 +15,7 @@
 #  include "config.h"
 #endif
 
+#ifndef HAVE_EXIV2
 
 #include <stdio.h>
 #include <string.h>
@@ -443,3 +444,5 @@ gint format_nikon_makernote(ExifData *exif, unsigned char *tiff, guint offset,
        return TRUE;
 }
 
+#endif 
+/* not HAVE_EXIV2 */
index 5724975..1953d74 100644 (file)
@@ -11,6 +11,7 @@
 #  include "config.h"
 #endif
 
+#ifndef HAVE_EXIV2
 
 #include <stdio.h>
 #include <string.h>
@@ -380,3 +381,5 @@ gint format_olympus_makernote(ExifData *exif, unsigned char *tiff, guint offset,
 }
 
 
+#endif 
+/* not HAVE_EXIV2 */
index 3e40588..3a369fe 100644 (file)
@@ -14,6 +14,7 @@
 #  include "config.h"
 #endif
 
+#ifndef HAVE_EXIV2
 
 #include <stdio.h>
 #include <string.h>
@@ -564,4 +565,6 @@ gint format_debug_tiff_raw(unsigned char *data, const guint len,
 }
 #endif
 
+#endif 
+/* not HAVE_EXIV2 */
 
index e9b67b8..b5cd2db 100644 (file)
@@ -425,7 +425,7 @@ static void image_post_process(ImageWindow *imd, gint clamp)
        if (exif_rotate_enable ||
            (imd->color_profile_enable && imd->color_profile_use_image) )
                {
-               exif = exif_read(imd->image_fd, (imd->color_profile_enable && imd->color_profile_use_image));
+               exif = exif_read(imd->image_fd->path, (imd->color_profile_enable && imd->color_profile_use_image));
                }
 
        if (exif_rotate_enable && exif)
@@ -624,7 +624,7 @@ static gint image_post_buffer_get(ImageWindow *imd)
                        {
                        ExifData *exif = NULL;
 
-                       if (imd->color_profile_use_image) exif = exif_read(imd->image_fd, TRUE);
+                       if (imd->color_profile_use_image) exif = exif_read(imd->image_fd->path, TRUE);
                        image_post_process_color(imd, imd->prev_color_row, exif);
                        exif_free(exif);
                        }
index 4f0f816..85f54d5 100644 (file)
@@ -1434,7 +1434,7 @@ static void pan_info_add_exif(PanTextAlignment *ta, FileData *fd)
        gint i;
 
        if (!fd) return;
-       exif = exif_read(fd, FALSE);
+       exif = exif_read(fd->path, FALSE);
        if (!exif) return;
 
        pan_text_alignment_add(ta, NULL, NULL);