From: Matthieu C. <ma...@us...> - 2003-08-28 15:44:35
|
Update of /cvsroot/libexif/libmnote/libmnote In directory sc8-pr-cvs1:/tmp/cvs-serv23705/libmnote Modified Files: mnote-data.c Log Message: Canon bugfixe Index: mnote-data.c =================================================================== RCS file: /cvsroot/libexif/libmnote/libmnote/mnote-data.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- mnote-data.c 25 Aug 2003 21:00:23 -0000 1.5 +++ mnote-data.c 28 Aug 2003 15:43:50 -0000 1.6 @@ -109,7 +109,7 @@ { MNoteData *note = NULL; ExifData *d = NULL; - ExifEntry *e = NULL; + ExifEntry *e = NULL, *cons = NULL; const unsigned char *p = data; if (!size || !data) return NULL; @@ -119,12 +119,18 @@ * to figure out which parser to use. */ d = exif_data_new_from_data (data, size); - if (d) e = exif_content_get_entry (d->ifd[EXIF_IFD_EXIF], + if (d) { + e = exif_content_get_entry (d->ifd[EXIF_IFD_EXIF], EXIF_TAG_MAKER_NOTE); + cons = exif_content_get_entry (d->ifd[EXIF_IFD_0], + EXIF_TAG_MAKE); + } if (e) p = e->data; /* Canon notes begin with 0x0000 */ - if ((size > 1) && (p[0] == 0x00) && (p[1] == 0x00)) { + if ((size > 1) && (( (p[0] == 0x00) && (p[1] == 0x00)) || + /*canon G3*/( (p[0] == 0x0E) && (p[1] == 0x00) ) || + (cons && !strcmp(exif_entry_get_value(cons), "Canon")) )){ #ifdef DEBUG printf ("Detected Canon maker note.\n"); #endif |