Skip to content

Commit

Permalink
started exiv2 integration
Browse files Browse the repository at this point in the history
  • Loading branch information
nadvornik committed Feb 13, 2008
1 parent dd9103a commit d5f4814
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 8 deletions.
8 changes: 8 additions & 0 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ AM_MAINTAINER_MODE

AC_ISC_POSIX
AC_PROG_CC
AC_PROG_CXX
AC_STDC_HEADERS
AC_ARG_PROGRAM

Expand Down Expand Up @@ -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")

Expand Down
1 change: 1 addition & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ gqview_SOURCES = \
editors.h \
exif.c \
exif.h \
exiv2.cc \
filelist.c \
filelist.h \
format_canon.c \
Expand Down
2 changes: 1 addition & 1 deletion src/bar_exif.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/cache-loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 6 additions & 2 deletions src/exif.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
# include "config.h"
#endif

#ifndef HAVE_EXIV2

#include <stdio.h>
#include <string.h>
#include <fcntl.h>
Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -1848,3 +1850,5 @@ void exif_write_data_list(ExifData *exif, FILE *f, gint human_readable_list)
fprintf(f, "----------------------------------------------------\n");
}

#endif
/* not HAVE_EXIV2 */
2 changes: 1 addition & 1 deletion src/exif.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions src/format_canon.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
# include "config.h"
#endif

#ifndef HAVE_EXIV2

#include <stdio.h>
#include <string.h>
Expand Down Expand Up @@ -629,3 +630,5 @@ gint format_canon_makernote(ExifData *exif, unsigned char *tiff, guint offset,
}


#endif
/* not HAVE_EXIV2 */
3 changes: 3 additions & 0 deletions src/format_fuji.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# include "config.h"
#endif

#ifndef HAVE_EXIV2

#include <stdio.h>
#include <string.h>
Expand Down Expand Up @@ -201,3 +202,5 @@ gint format_fuji_makernote(ExifData *exif, unsigned char *tiff, guint offset,
return TRUE;
}

#endif
/* not HAVE_EXIV2 */
3 changes: 3 additions & 0 deletions src/format_nikon.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# include "config.h"
#endif

#ifndef HAVE_EXIV2

#include <stdio.h>
#include <string.h>
Expand Down Expand Up @@ -443,3 +444,5 @@ gint format_nikon_makernote(ExifData *exif, unsigned char *tiff, guint offset,
return TRUE;
}

#endif
/* not HAVE_EXIV2 */
3 changes: 3 additions & 0 deletions src/format_olympus.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# include "config.h"
#endif

#ifndef HAVE_EXIV2

#include <stdio.h>
#include <string.h>
Expand Down Expand Up @@ -380,3 +381,5 @@ gint format_olympus_makernote(ExifData *exif, unsigned char *tiff, guint offset,
}


#endif
/* not HAVE_EXIV2 */
3 changes: 3 additions & 0 deletions src/format_raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# include "config.h"
#endif

#ifndef HAVE_EXIV2

#include <stdio.h>
#include <string.h>
Expand Down Expand Up @@ -564,4 +565,6 @@ gint format_debug_tiff_raw(unsigned char *data, const guint len,
}
#endif

#endif
/* not HAVE_EXIV2 */

4 changes: 2 additions & 2 deletions src/image.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/pan-view.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d5f4814

Please sign in to comment.