Commit 11259501 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

require libexif >= 0.6.0.

2007-05-06  Sven Neumann  <sven@gimp.org>

	* configure.in: require libexif >= 0.6.0.

	* plug-ins/jpeg/gimpexif.[ch]: removed 
gimp_exif_entry_get_value()
	which was needed to work with libexif < 0.6.0.

	* plug-ins/jpeg/jpeg.c: declare the global ExifData here instead
	of in gimpexif.c.

	* plug-ins/jpeg/jpeg-exif.c: cosmetics.


svn path=/trunk/; revision=22436
parent 24ef1332
2007-05-06 Sven Neumann <sven@gimp.org>
* configure.in: require libexif >= 0.6.0.
* plug-ins/jpeg/gimpexif.[ch]: removed gimp_exif_entry_get_value()
which was needed to work with libexif < 0.6.0.
* plug-ins/jpeg/jpeg.c: declare the global ExifData here instead
of in gimpexif.c.
* plug-ins/jpeg/jpeg-exif.c: cosmetics.
2007-05-06 Sven Neumann <sven@gimp.org>
* plug-ins/jpeg/jpeg-exif.c (jpeg_apply_exif_data_to_image): only
......@@ -58,6 +58,7 @@ m4_define([gnome_keyring_required_version], [0.4.5])
m4_define([libcurl_required_version], [7.15.1])
m4_define([dbus_glib_required_version], [0.70])
m4_define([libhal_required_version], [0.5.7])
m4_define([exif_required_version], [0.6.0])
AC_INIT([GIMP], [gimp_version],
......@@ -1105,20 +1106,9 @@ have_libexif=no
AC_ARG_WITH(libexif, [ --without-libexif build without EXIF support])
if test x$with_libexif != xno && test -z "$LIBEXIF" && test -n "$LIBJPEG"; then
have_libexif=yes
PKG_CHECK_MODULES(EXIF, libexif,
PKG_CHECK_MODULES(EXIF, libexif >= exif_required_version,
AC_DEFINE(HAVE_EXIF, 1, [Define to 1 if libexif is available]),
have_libexif="no (libexif not found)")
AC_MSG_CHECKING([if libexif is version 0.6.0 or newer])
if $PKG_CONFIG --atleast-version=0.6.0 libexif; then
have_exif_0_6=yes
else
have_exif_0_6=no
fi
AC_MSG_RESULT($have_exif_0_6)
if test x$have_exif_0_6 == xyes; then
AC_DEFINE(HAVE_EXIF_0_6, 1,
[Define to 1 if libexif is at least version 0.6.0])
fi
fi
AC_SUBST(EXIF_CFLAGS)
......
......@@ -34,7 +34,6 @@
#include "gimpexif.h"
ExifData *exif_data;
/*
* gimp_metadata_store_exif:
......@@ -85,7 +84,7 @@ void gimp_metadata_store_exif (gint32 image_ID,
* returns: The reconstructed exif data, or NULL if none exists.
*/
ExifData *
gimp_metadata_generate_exif (gint32 image_ID)
gimp_metadata_generate_exif (gint32 image_ID)
{
ExifData *exif_data;
GimpParasite *parasite = gimp_image_parasite_find (image_ID,
......@@ -102,7 +101,6 @@ gimp_metadata_generate_exif (gint32 image_ID)
return NULL;
}
/*
* gimp_exif_content_get_value:
* @content: ExifContent block from which to get value
......@@ -117,45 +115,19 @@ gimp_metadata_generate_exif (gint32 image_ID)
* @value must be pre-allocated.
*/
const gchar *
gimp_exif_content_get_value (ExifContent *content,
ExifTag tag,
gchar *value,
gint maxlen)
gimp_exif_content_get_value (ExifContent *content,
ExifTag tag,
gchar *value,
gint maxlen)
{
ExifEntry *entry = exif_content_get_entry (content, tag);
if (entry)
return gimp_exif_entry_get_value (entry, value, maxlen);
return exif_entry_get_value (entry, value, maxlen);
else
return NULL;
}
/*
* gimp_exif_entry_get_value:
* @content: ExifEntry from which to get value
* @value: Place to put the result
* @maxlen: Maximum size of returned string
*
* This function is a wrapper around the libexif function
* exif_entry_get_value(), necessary to deal with an incompatible
* API change. It looks up the value of the specifed entry,
* returning the result as a human-readable string. Note that
* @value must be pre-allocated.
*/
const gchar *
gimp_exif_entry_get_value (ExifEntry *entry,
gchar *value,
guint maxlen)
{
#ifdef HAVE_EXIF_0_6
return exif_entry_get_value (entry, value, maxlen);
#else
strncpy (value, exif_entry_get_value (entry), maxlen);
return value;
#endif /* HAVE_EXIF_0_6 */
}
/*
* gimp_exif_data_remove_entry:
* @data: ExifData pointer
......@@ -167,9 +139,9 @@ gimp_exif_entry_get_value (ExifEntry *entry,
* exists, the function returns without doing anything.
*/
void
gimp_exif_data_remove_entry (ExifData *exif_data,
ExifIfd ifd,
ExifTag tag)
gimp_exif_data_remove_entry (ExifData *exif_data,
ExifIfd ifd,
ExifTag tag)
{
ExifEntry *entry = exif_content_get_entry (exif_data->ifd[ifd],
tag);
......
......@@ -25,22 +25,18 @@
#define EXIF_HEADER_SIZE 8
void gimp_metadata_store_exif (gint32 image_ID,
ExifData *exif_data);
void gimp_metadata_store_exif (gint32 image_ID,
ExifData *exif_data);
ExifData * gimp_metadata_generate_exif (gint32 image_ID);
ExifData * gimp_metadata_generate_exif (gint32 image_ID);
const gchar * gimp_exif_content_get_value (ExifContent *content,
ExifTag tag,
gchar *value,
gint maxlen);
const gchar * gimp_exif_content_get_value (ExifContent *content,
ExifTag tag,
gchar *value,
gint maxlen);
const gchar * gimp_exif_entry_get_value (ExifEntry *entry,
gchar *value,
guint maxlen);
void gimp_exif_data_remove_entry (ExifData *exif_data,
ExifIfd ifd,
ExifTag tag);
void gimp_exif_data_remove_entry (ExifData *exif_data,
ExifIfd ifd,
ExifTag tag);
#endif /* HAVE_EXIF */
......@@ -87,9 +87,9 @@ void
jpeg_apply_exif_data_to_image (const gchar *filename,
const gint32 image_ID)
{
ExifData *exif_data = NULL;
ExifEntry *entry;
gint byte_order;
ExifData *exif_data = NULL;
ExifEntry *entry;
gint byte_order;
exif_data = jpeg_exif_data_new_from_file (filename, NULL);
if (!exif_data)
......@@ -132,8 +132,8 @@ jpeg_apply_exif_data_to_image (const gchar *filename,
void
jpeg_setup_exif_for_save (ExifData *exif_data,
const gint32 image_ID)
jpeg_setup_exif_for_save (ExifData *exif_data,
const gint32 image_ID)
{
ExifRational r;
gdouble xres, yres;
......
......@@ -58,6 +58,10 @@ JpegSaveVals jsvals;
gint32 orig_image_ID_global;
gint32 drawable_ID_global;
#ifdef HAVE_EXIF
ExifData *exif_data = NULL;
#endif
const GimpPlugInInfo PLUG_IN_INFO =
{
NULL, /* init_proc */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment