From: Lutz <lu...@us...> - 2004-05-03 19:04:07
|
On Mon, 2004-05-03 at 01:11, Antonio Scuri wrote: > Because this is very inefficient. The function exif_tag_get_name has a > loop looking for tag "i" every time is called. > Understood. You are perhaps looking for something like this: Index: exif-tag.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-tag.c,v retrieving revision 1.14 diff -u -3 -p -r1.14 exif-tag.c --- exif-tag.c 6 Aug 2003 19:47:53 -0000 1.14 +++ exif-tag.c 3 May 2004 19:00:58 -0000 @@ -571,6 +571,29 @@ static struct { {0, NULL, NULL, NULL} }; +/* For now, do not use these functions. */ +ExifTag exif_tag_table_get_tag (unsigned int n); +const char *exif_tag_table_get_name (unsigned int n); +unsigned int exif_tag_table_count (void); + +ExifTag +exif_tag_table_get_tag (unsigned int n) +{ + return (n < exif_tag_table_count ()) ? ExifTagTable[n].tag : 0; +} + +const char * +exif_tag_table_get_name (unsigned int n) +{ + return (n < exif_tag_table_count ()) ? ExifTagTable[n].name : NULL; +} + +unsigned int +exif_tag_table_count (void) +{ + return sizeof (ExifTagTable) / sizeof (ExifTagTable[0]); +} + const char * exif_tag_get_name (ExifTag tag) { > > > 5) I have to edit the function exif_entry_initialize from "exif-entry.c". > > > There are lots of uninitialized tags. I simply replace the function > > with my > > > version. Then saving exif tags in jpeg came back to normal. > > > >What is your version? Could you produce a patch against CVS? > > I checkout from CVS before making those changes. I'm sending the > function attached. Just cut and paste. I don't see where your version differs from the one in CVS. Regards Lutz |