Commit 76353a06 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

plug-ins/jpeg/jpeg-exif.c plug-ins/jpeg/jpeg-load.c added a utility

2006-03-28  Sven Neumann  <sven@gimp.org>

	* plug-ins/jpeg/jpeg-exif.c
	* plug-ins/jpeg/jpeg-load.c
	* plug-ins/jpeg/jpeg.h: added a utility function to work around
	filename encoding problems when reading EXIF data (bug #335391).
parent ec5d800f
2006-03-28 Sven Neumann <sven@gimp.org>
* plug-ins/jpeg/jpeg-exif.c
* plug-ins/jpeg/jpeg-load.c
* plug-ins/jpeg/jpeg.h: added a utility function to work around
filename encoding problems when reading EXIF data (bug #335391).
2006-03-28 Sven Neumann <sven@gimp.org>
 
* plug-ins/flame/flame.c
......
......@@ -55,15 +55,40 @@ static gboolean jpeg_query (const gchar *primary,
const gchar *ok_label);
/* Replacement for exif_data_new_from_file() to work around
* filename encoding problems (see bug #335391).
*/
ExifData *
jpeg_exif_data_new_from_file (const gchar *filename,
GError **error)
{
ExifData *data;
GMappedFile *file;
g_return_val_if_fail (filename != NULL, NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
file = g_mapped_file_new (filename, FALSE, error);
if (! file)
return NULL;
data = exif_data_new_from_data ((guchar *) g_mapped_file_get_contents (file),
g_mapped_file_get_length (file));
g_mapped_file_free (file);
return data;
}
void
jpeg_apply_exif_data_to_image (const gchar *filename,
const gint32 image_ID)
jpeg_apply_exif_data_to_image (const gchar *filename,
const gint32 image_ID)
{
ExifData *exif_data = NULL;
ExifEntry *entry;
gint byte_order;
exif_data = exif_data_new_from_file (filename);
exif_data = jpeg_exif_data_new_from_file (filename, NULL);
if (!exif_data)
return;
......
......@@ -590,7 +590,7 @@ load_thumbnail_image (const gchar *filename,
FILE *infile;
image_ID = -1;
exif_data = exif_data_new_from_file (filename);
exif_data = jpeg_exif_data_new_from_file (filename, NULL);
if (! ((exif_data) && (exif_data->data) && (exif_data->size > 0)))
return -1;
......
......@@ -62,12 +62,15 @@ void my_output_message (j_common_ptr cinfo);
#ifdef HAVE_EXIF
ExifData *exif_data;
ExifData *exif_data;
gint32 load_thumbnail_image (const gchar *filename,
gint *width,
gint *height);
ExifData * jpeg_exif_data_new_from_file (const gchar *filename,
GError **error);
void jpeg_apply_exif_data_to_image (const gchar *filename,
const gint32 image_ID);
......
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