You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(22) |
Sep
(57) |
Oct
(39) |
Nov
(93) |
Dec
(72) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(15) |
Feb
(8) |
Mar
(12) |
Apr
(25) |
May
(2) |
Jun
|
Jul
(11) |
Aug
(32) |
Sep
(18) |
Oct
(53) |
Nov
|
Dec
(11) |
2004 |
Jan
(19) |
Feb
(1) |
Mar
(15) |
Apr
(17) |
May
(56) |
Jun
(19) |
Jul
(6) |
Aug
(16) |
Sep
(44) |
Oct
(31) |
Nov
(36) |
Dec
(13) |
2005 |
Jan
(2) |
Feb
(41) |
Mar
(304) |
Apr
(176) |
May
(19) |
Jun
(33) |
Jul
(14) |
Aug
(21) |
Sep
(4) |
Oct
(3) |
Nov
|
Dec
(8) |
2006 |
Jan
(18) |
Feb
(9) |
Mar
(5) |
Apr
(2) |
May
(2) |
Jun
(4) |
Jul
(2) |
Aug
|
Sep
(7) |
Oct
(10) |
Nov
|
Dec
|
2007 |
Jan
|
Feb
(3) |
Mar
(1) |
Apr
(4) |
May
(124) |
Jun
(59) |
Jul
(1) |
Aug
(13) |
Sep
(3) |
Oct
(11) |
Nov
(30) |
Dec
(35) |
2008 |
Jan
(31) |
Feb
(42) |
Mar
(4) |
Apr
(5) |
May
(2) |
Jun
(12) |
Jul
(8) |
Aug
(2) |
Sep
(4) |
Oct
(5) |
Nov
(89) |
Dec
(23) |
2009 |
Jan
(71) |
Feb
(5) |
Mar
(8) |
Apr
(7) |
May
(8) |
Jun
(7) |
Jul
|
Aug
(4) |
Sep
(58) |
Oct
(74) |
Nov
(53) |
Dec
(32) |
2010 |
Jan
(8) |
Feb
(13) |
Mar
(4) |
Apr
|
May
|
Jun
(10) |
Jul
(1) |
Aug
(2) |
Sep
(12) |
Oct
(17) |
Nov
(2) |
Dec
(24) |
2011 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(24) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
(20) |
Mar
(18) |
Apr
|
May
|
Jun
|
Jul
(5) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(12) |
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(8) |
Jun
|
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(5) |
From: Lutz M. <lu...@us...> - 2004-12-17 04:23:07
|
Update of /cvsroot/libexif/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1098/libexif Modified Files: exif-loader.c Log Message: 2004-12-17 Lutz Mueller <lu...@us...> * libexif/exif-loader.c: Work towards a non-recursive version of (exif_loader_write). Index: exif-loader.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-loader.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- exif-loader.c 17 Dec 2004 04:15:25 -0000 1.16 +++ exif-loader.c 17 Dec 2004 04:22:45 -0000 1.17 @@ -173,9 +173,9 @@ for (i = 0; i < sizeof (eld->b); i++) switch (eld->state) { case EL_EXIF_FOUND: - if (!exif_loader_write (eld, eld->b + i, + if (!exif_loader_copy (eld, eld->b + i, sizeof (eld->b) - i)) return 0; - return exif_loader_write (eld, buf, len); + return exif_loader_copy (eld, buf, len); case EL_SKIP_BYTES: eld->size--; if (!eld->size) eld->state = EL_READ; |
From: Lutz M. <lu...@us...> - 2004-12-17 04:15:35
|
Update of /cvsroot/libexif/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32294/libexif Modified Files: exif-loader.c Log Message: 2004-12-17 Lutz Mueller <lu...@us...> Lars Ellenberg <l....@we...> fixed a bug that I introduced in the last commit: * libexif/exif-loader.c: Don't substract 2 bytes twice. Index: exif-loader.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-loader.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- exif-loader.c 12 Dec 2004 12:55:20 -0000 1.15 +++ exif-loader.c 17 Dec 2004 04:15:25 -0000 1.16 @@ -195,7 +195,6 @@ break; case EL_READ_SIZE_BYTE_00: eld->size |= eld->b[i] << 0; - eld->size -= 2; switch (eld->data_format) { case EL_DATA_FORMAT_JPEG: eld->state = EL_SKIP_BYTES; |
From: Lutz M. <lu...@us...> - 2004-12-17 04:15:34
|
Update of /cvsroot/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32294 Modified Files: ChangeLog Log Message: 2004-12-17 Lutz Mueller <lu...@us...> Lars Ellenberg <l....@we...> fixed a bug that I introduced in the last commit: * libexif/exif-loader.c: Don't substract 2 bytes twice. Index: ChangeLog =================================================================== RCS file: /cvsroot/libexif/libexif/ChangeLog,v retrieving revision 1.176 retrieving revision 1.177 diff -u -d -r1.176 -r1.177 --- ChangeLog 12 Dec 2004 12:55:19 -0000 1.176 +++ ChangeLog 17 Dec 2004 04:15:25 -0000 1.177 @@ -1,3 +1,10 @@ +2004-12-17 Lutz Mueller <lu...@us...> + + Lars Ellenberg <l....@we...> fixed a bug that I introduced + in the last commit: + + * libexif/exif-loader.c: Don't substract 2 bytes twice. + 2004-12-12 Lutz Mueller <lu...@us...> Pointed out by Lars Ellenberg <l....@we...>: |
From: Jan P. <pa...@us...> - 2004-12-16 21:00:52
|
Update of /cvsroot/libexif/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5955 Modified Files: exif-data.c Log Message: Don't crash if IFD1 offset out of available data Index: exif-data.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-data.c,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- exif-data.c 11 Dec 2004 04:28:47 -0000 1.61 +++ exif-data.c 16 Dec 2004 21:00:26 -0000 1.62 @@ -719,7 +719,13 @@ ds - 6, offset); /* IFD 1 offset */ + if (offset + 6 + 2 > ds) { + return; + } n = exif_get_short (d + 6 + offset, data->priv->order); + if (offset + 6 + 2 + 12 * n + 4 > ds) { + return; + } offset = exif_get_long (d + 6 + offset + 2 + 12 * n, data->priv->order); if (offset) { exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", |
From: Lutz M. <lu...@us...> - 2004-12-12 12:55:28
|
Update of /cvsroot/libexif/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3893/libexif Modified Files: exif-loader.c Log Message: 2004-12-12 Lutz Mueller <lu...@us...> Pointed out by Lars Ellenberg <l....@we...>: * libexif/exif-loader.c: Honor indirect offsets in FUJI_RAW-files. Don't perform unnecessary checks for known data formats. Index: exif-loader.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-loader.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- exif-loader.c 11 Dec 2004 04:28:48 -0000 1.14 +++ exif-loader.c 12 Dec 2004 12:55:20 -0000 1.15 @@ -11,16 +11,24 @@ typedef enum { EL_READ = 0, - EL_READ_SIZE_HIGH_BYTE, - EL_READ_SIZE_LOW_BYTE, - EL_READ_SIZE_HIGH_BYTE_FINAL, - EL_READ_SIZE_LOW_BYTE_FINAL, + EL_READ_SIZE_BYTE_24, + EL_READ_SIZE_BYTE_16, + EL_READ_SIZE_BYTE_08, + EL_READ_SIZE_BYTE_00, EL_SKIP_BYTES, EL_EXIF_FOUND, } ExifLoaderState; +typedef enum { + EL_DATA_FORMAT_UNKNOWN, + EL_DATA_FORMAT_EXIF, + EL_DATA_FORMAT_JPEG, + EL_DATA_FORMAT_FUJI_RAW +} ExifLoaderDataFormat; + struct _ExifLoader { ExifLoaderState state; + ExifLoaderDataFormat data_format; /* Small buffer used for detection of format */ unsigned char b[12]; @@ -107,10 +115,18 @@ return exif_loader_copy (eld, buf, len); case EL_SKIP_BYTES: if (eld->size > len) { eld->size -= len; return 1; } - eld->state = EL_READ; len -= eld->size; buf += eld->size; + eld->size = 0; eld->b_len = 0; + switch (eld->data_format) { + case EL_DATA_FORMAT_FUJI_RAW: + eld->state = EL_READ_SIZE_BYTE_24; + break; + default: + eld->state = EL_READ; + break; + } break; default: break; @@ -132,12 +148,26 @@ len -= i; } - /* Check the small buffer against known formats. */ - if (!memcmp (eld->b, "FUJIFILM", 8)) { - eld->state = EL_SKIP_BYTES; - eld->size = 112; - } else if (!memcmp (eld->b + 2, ExifHeader, sizeof (ExifHeader))) { - eld->state = EL_READ_SIZE_HIGH_BYTE_FINAL; + switch (eld->data_format) { + case EL_DATA_FORMAT_UNKNOWN: + + /* Check the small buffer against known formats. */ + if (!memcmp (eld->b, "FUJIFILM", 8)) { + + /* Skip to byte 84. There is another offset there. */ + eld->data_format = EL_DATA_FORMAT_FUJI_RAW; + eld->size = 84; + eld->state = EL_SKIP_BYTES; + eld->size = 84; + + } else if (!memcmp (eld->b + 2, ExifHeader, sizeof (ExifHeader))) { + + /* Read the size (2 bytes). */ + eld->data_format = EL_DATA_FORMAT_EXIF; + eld->state = EL_READ_SIZE_BYTE_08; + } + default: + break; } for (i = 0; i < sizeof (eld->b); i++) @@ -150,32 +180,53 @@ eld->size--; if (!eld->size) eld->state = EL_READ; break; - case EL_READ_SIZE_HIGH_BYTE: - eld->size = eld->b[i] << 8; - eld->state = EL_READ_SIZE_LOW_BYTE; + + case EL_READ_SIZE_BYTE_24: + eld->size |= eld->b[i] << 24; + eld->state = EL_READ_SIZE_BYTE_16; break; - case EL_READ_SIZE_HIGH_BYTE_FINAL: - eld->size = eld->b[i] << 8; - eld->state = EL_READ_SIZE_LOW_BYTE_FINAL; + case EL_READ_SIZE_BYTE_16: + eld->size |= eld->b[i] << 16; + eld->state = EL_READ_SIZE_BYTE_08; break; - case EL_READ_SIZE_LOW_BYTE: - eld->size |= eld->b[i]; - eld->state = EL_SKIP_BYTES; - eld->size -= 2; + case EL_READ_SIZE_BYTE_08: + eld->size |= eld->b[i] << 8; + eld->state = EL_READ_SIZE_BYTE_00; break; - case EL_READ_SIZE_LOW_BYTE_FINAL: - eld->size |= eld->b[i]; - eld->state = EL_EXIF_FOUND; + case EL_READ_SIZE_BYTE_00: + eld->size |= eld->b[i] << 0; + eld->size -= 2; + switch (eld->data_format) { + case EL_DATA_FORMAT_JPEG: + eld->state = EL_SKIP_BYTES; + eld->size -= 2; + break; + case EL_DATA_FORMAT_FUJI_RAW: + eld->data_format = EL_DATA_FORMAT_EXIF; + eld->state = EL_SKIP_BYTES; + eld->size -= 86; + break; + case EL_DATA_FORMAT_EXIF: + eld->state = EL_EXIF_FOUND; + break; + default: + break; + } break; + default: switch (eld->b[i]) { case JPEG_MARKER_APP1: - eld->state = EL_READ_SIZE_HIGH_BYTE_FINAL; + eld->data_format = EL_DATA_FORMAT_EXIF; + eld->size = 0; + eld->state = EL_READ_SIZE_BYTE_08; break; case JPEG_MARKER_APP0: case JPEG_MARKER_APP13: case JPEG_MARKER_COM: - eld->state = EL_READ_SIZE_HIGH_BYTE; + eld->data_format = EL_DATA_FORMAT_JPEG; + eld->size = 0; + eld->state = EL_READ_SIZE_BYTE_08; break; case 0xff: case JPEG_MARKER_SOI: @@ -263,6 +314,7 @@ loader->bytes_read = 0; loader->state = 0; loader->b_len = 0; + loader->data_format = EL_DATA_FORMAT_UNKNOWN; } ExifData * |
From: Lutz M. <lu...@us...> - 2004-12-12 12:55:28
|
Update of /cvsroot/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3893 Modified Files: ChangeLog Log Message: 2004-12-12 Lutz Mueller <lu...@us...> Pointed out by Lars Ellenberg <l....@we...>: * libexif/exif-loader.c: Honor indirect offsets in FUJI_RAW-files. Don't perform unnecessary checks for known data formats. Index: ChangeLog =================================================================== RCS file: /cvsroot/libexif/libexif/ChangeLog,v retrieving revision 1.175 retrieving revision 1.176 diff -u -d -r1.175 -r1.176 --- ChangeLog 11 Dec 2004 04:28:47 -0000 1.175 +++ ChangeLog 12 Dec 2004 12:55:19 -0000 1.176 @@ -1,3 +1,10 @@ +2004-12-12 Lutz Mueller <lu...@us...> + + Pointed out by Lars Ellenberg <l....@we...>: + + * libexif/exif-loader.c: Honor indirect offsets in FUJI_RAW-files. + Don't perform unnecessary checks for known data formats. + 2004-12-11 Lutz Mueller <lu...@us...> Inspired by suggestions from Lars Ellenberg <l....@we...>: |
From: Lutz M. <lu...@us...> - 2004-12-11 04:28:59
|
Update of /cvsroot/libexif/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv969/libexif Modified Files: exif-data.c exif-loader.c Log Message: 2004-12-11 Lutz Mueller <lu...@us...> Inspired by suggestions from Lars Ellenberg <l....@we...>: * libexif/exif-data.c: Fix spelling error. * libexif/exif-loader.c (exif_loader_write): Rewrite logic to make the loader handle more file types. Index: exif-data.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-data.c,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 --- exif-data.c 16 Nov 2004 23:52:19 -0000 1.60 +++ exif-data.c 11 Dec 2004 04:28:47 -0000 1.61 @@ -346,7 +346,7 @@ default: /* - * If we don't know the tag, changes are high + * If we don't know the tag, chances are high * that the EXIF data does not follow the standard. */ if (!exif_tag_get_name (tag)) { Index: exif-loader.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-loader.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- exif-loader.c 10 Nov 2004 18:53:39 -0000 1.13 +++ exif-loader.c 11 Dec 2004 04:28:48 -0000 1.14 @@ -13,16 +13,20 @@ EL_READ = 0, EL_READ_SIZE_HIGH_BYTE, EL_READ_SIZE_LOW_BYTE, + EL_READ_SIZE_HIGH_BYTE_FINAL, + EL_READ_SIZE_LOW_BYTE_FINAL, EL_SKIP_BYTES, EL_EXIF_FOUND, - EL_FAILED } ExifLoaderState; struct _ExifLoader { ExifLoaderState state; + /* Small buffer used for detection of format */ + unsigned char b[12]; + unsigned char b_len; + unsigned int size; - int last_marker; unsigned char *buf; unsigned int bytes_read; @@ -32,6 +36,8 @@ ExifMem *mem; }; +static const unsigned char ExifHeader[] = {0x45, 0x78, 0x69, 0x66, 0x00, 0x00}; + static void * exif_loader_alloc (ExifLoader *l, unsigned int i) { @@ -72,112 +78,125 @@ fclose (f); } +static unsigned int +exif_loader_copy (ExifLoader *eld, unsigned char *buf, unsigned int len) +{ + if (!eld || (len && !buf) || (eld->bytes_read >= eld->size)) return 0; + + /* If needed, allocate the buffer. */ + if (!eld->buf) eld->buf = exif_loader_alloc (eld, eld->size); + if (!eld->buf) return 0; + + /* Copy memory */ + len = MIN (len, eld->size - eld->bytes_read); + memcpy (eld->buf + eld->bytes_read, buf, len); + eld->bytes_read += len; + + return (eld->bytes_read >= eld->size) ? 0 : 1; +} + unsigned char exif_loader_write (ExifLoader *eld, unsigned char *buf, unsigned int len) { - unsigned int i, len_remain; + unsigned int i; - if (!eld || !buf || !len) return 0; - if (eld->state == EL_FAILED) return 0; - if (eld->size && eld->bytes_read == eld->size) return 0; + if (!eld || (len && !buf)) return 0; + + switch (eld->state) { + case EL_EXIF_FOUND: + return exif_loader_copy (eld, buf, len); + case EL_SKIP_BYTES: + if (eld->size > len) { eld->size -= len; return 1; } + eld->state = EL_READ; + len -= eld->size; + buf += eld->size; + eld->b_len = 0; + break; + default: + break; + } exif_log (eld->log, EXIF_LOG_CODE_DEBUG, "ExifLoader", "Scanning %i byte(s) of data...", len); - for (i = 0; (i < len) && (eld->state != EL_EXIF_FOUND) && - (eld->state != EL_FAILED); i++) + /* + * First fill the small buffer. Only continue if the buffer + * is filled. Note that EXIF data contains at least 12 bytes. + */ + i = MIN (len, sizeof (eld->b) - eld->b_len); + if (i) { + memcpy (&eld->b[eld->b_len], buf, i); + eld->b_len += i; + if (eld->b_len < sizeof (eld->b)) return 1; + buf += i; + len -= i; + } + + /* Check the small buffer against known formats. */ + if (!memcmp (eld->b, "FUJIFILM", 8)) { + eld->state = EL_SKIP_BYTES; + eld->size = 112; + } else if (!memcmp (eld->b + 2, ExifHeader, sizeof (ExifHeader))) { + eld->state = EL_READ_SIZE_HIGH_BYTE_FINAL; + } + + for (i = 0; i < sizeof (eld->b); i++) switch (eld->state) { + case EL_EXIF_FOUND: + if (!exif_loader_write (eld, eld->b + i, + sizeof (eld->b) - i)) return 0; + return exif_loader_write (eld, buf, len); case EL_SKIP_BYTES: eld->size--; - if (eld->size == 0) { - eld->state = EL_READ; - } + if (!eld->size) eld->state = EL_READ; break; - case EL_READ_SIZE_HIGH_BYTE: - eld->size = buf [i] << 8; + eld->size = eld->b[i] << 8; eld->state = EL_READ_SIZE_LOW_BYTE; break; - + case EL_READ_SIZE_HIGH_BYTE_FINAL: + eld->size = eld->b[i] << 8; + eld->state = EL_READ_SIZE_LOW_BYTE_FINAL; + break; case EL_READ_SIZE_LOW_BYTE: - eld->size |= buf [i]; - - switch (eld->last_marker) { + eld->size |= eld->b[i]; + eld->state = EL_SKIP_BYTES; + eld->size -= 2; + break; + case EL_READ_SIZE_LOW_BYTE_FINAL: + eld->size |= eld->b[i]; + eld->state = EL_EXIF_FOUND; + break; + default: + switch (eld->b[i]) { + case JPEG_MARKER_APP1: + eld->state = EL_READ_SIZE_HIGH_BYTE_FINAL; + break; case JPEG_MARKER_APP0: case JPEG_MARKER_APP13: case JPEG_MARKER_COM: - eld->state = EL_SKIP_BYTES; - eld->size -= 2; - break; - - case JPEG_MARKER_APP1: - eld->state = EL_EXIF_FOUND; + eld->state = EL_READ_SIZE_HIGH_BYTE; break; - - case 0: - /* - * Assume that we are reading EXIF data. - * This should probably be verified by reading - * some bytes ahead. - */ - eld->state = EL_EXIF_FOUND; + case 0xff: + case JPEG_MARKER_SOI: break; default: + exif_log (eld->log, + EXIF_LOG_CODE_CORRUPT_DATA, + "ExifLoader", _("The data supplied " + "does not seem to contain " + "EXIF data.")); + exif_loader_reset (eld); return 0; } - - eld->last_marker = 0; - break; - - default: - if (buf[i] != 0xff) { - if (buf[i] == JPEG_MARKER_APP0 || - buf[i] == JPEG_MARKER_APP1 || - buf[i] == JPEG_MARKER_APP13 || - buf[i] == JPEG_MARKER_COM) { - eld->state = EL_READ_SIZE_HIGH_BYTE; - eld->last_marker = buf [i]; - - } else if (buf [i] == JPEG_MARKER_SOI) { - /* Nothing */ - } else { - /* Assume that we are reading EXIF - * data. This should probably be - * verified by reading some bytes - * ahead. - */ - eld->last_marker = JPEG_MARKER_APP1; - eld->state = EL_READ_SIZE_HIGH_BYTE; - i--; - } - } - } - - len_remain = len - i; - if (!len_remain) return 1; - - if (eld->state == EL_EXIF_FOUND) { - if (eld->buf == NULL) { - eld->buf = exif_loader_alloc (eld, eld->size); - if (!eld->buf) return 0; - eld->bytes_read = 0; } - if (eld->bytes_read < eld->size) { - int cp_len; - - /* the number of bytes we need to copy */ - cp_len = MIN (eld->size - eld->bytes_read, len_remain); - - if ((cp_len + eld->bytes_read) > eld->size) return 1; - - /* Copy memory */ - memcpy (eld->buf + eld->bytes_read, &buf[i], cp_len); - eld->bytes_read += cp_len; - } - } - - return 1; + /* + * If we reach this point, the buffer has not been big enough + * to read all data we need. Fill it with new data. + */ + eld->b_len = 0; + return exif_loader_write (eld, buf, len); } ExifLoader * @@ -242,8 +261,8 @@ exif_mem_free (loader->mem, loader->buf); loader->buf = NULL; loader->size = 0; loader->bytes_read = 0; - loader->last_marker = 0; loader->state = 0; + loader->b_len = 0; } ExifData * |
From: Lutz M. <lu...@us...> - 2004-12-11 04:28:56
|
Update of /cvsroot/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv969 Modified Files: ChangeLog Log Message: 2004-12-11 Lutz Mueller <lu...@us...> Inspired by suggestions from Lars Ellenberg <l....@we...>: * libexif/exif-data.c: Fix spelling error. * libexif/exif-loader.c (exif_loader_write): Rewrite logic to make the loader handle more file types. Index: ChangeLog =================================================================== RCS file: /cvsroot/libexif/libexif/ChangeLog,v retrieving revision 1.174 retrieving revision 1.175 diff -u -d -r1.174 -r1.175 --- ChangeLog 8 Dec 2004 07:04:56 -0000 1.174 +++ ChangeLog 11 Dec 2004 04:28:47 -0000 1.175 @@ -1,4 +1,13 @@ +2004-12-11 Lutz Mueller <lu...@us...> + + Inspired by suggestions from Lars Ellenberg <l....@we...>: + + * libexif/exif-data.c: Fix spelling error. + * libexif/exif-loader.c (exif_loader_write): Rewrite logic to + make the loader handle more file types. + 2004-12-08 Jan Patera <pa...@us...> + * libexif/exif-entry.c: Data format of EXIF_TAG_USER_COMMENT: Some packages like Canon ZoomBrowser EX 4.5 store only one zero byte followed by 7 bytes of rubbish |
From: Jan P. <pa...@us...> - 2004-12-08 07:05:08
|
Update of /cvsroot/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2177 Modified Files: ChangeLog Log Message: 2004-12-08 Jan Patera <pa...@us...> * libexif/exif-entry.c: Data format of EXIF_TAG_USER_COMMENT: Some packages like Canon ZoomBrowser EX 4.5 store only one zero byte followed by 7 bytes of rubbish Index: ChangeLog =================================================================== RCS file: /cvsroot/libexif/libexif/ChangeLog,v retrieving revision 1.173 retrieving revision 1.174 diff -u -d -r1.173 -r1.174 --- ChangeLog 16 Nov 2004 23:52:19 -0000 1.173 +++ ChangeLog 8 Dec 2004 07:04:56 -0000 1.174 @@ -1,3 +1,8 @@ +2004-12-08 Jan Patera <pa...@us...> + * libexif/exif-entry.c: Data format of EXIF_TAG_USER_COMMENT: + Some packages like Canon ZoomBrowser EX 4.5 store only + one zero byte followed by 7 bytes of rubbish + 2004-11-17 Lutz Mueller <lu...@us...> * libexif/exif-data.c: Make the last commit actually work. |
From: Jan P. <pa...@us...> - 2004-12-08 07:00:32
|
Update of /cvsroot/libexif/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1290 Modified Files: exif-entry.c Log Message: EXIF_TAG_USER_COMMENT: Some packages like Canon ZoomBrowser EX 4.5 store only one zero byte followed by 7 bytes of rubbish Index: exif-entry.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-entry.c,v retrieving revision 1.72 retrieving revision 1.73 diff -u -d -r1.72 -r1.73 --- exif-entry.c 11 Nov 2004 20:33:11 -0000 1.72 +++ exif-entry.c 8 Dec 2004 07:00:22 -0000 1.73 @@ -258,6 +258,11 @@ exif_format_get_name (e->format)); e->format = EXIF_FORMAT_UNDEFINED; } + /* Some packages like Canon ZoomBrowser EX 4.5 store + only one zero byte followed by 7 bytes of rubbish */ + if ((e->size >= 8) && (e->data[0] == 0)) { + memcpy(e->data, "\0\0\0\0\0\0\0\0", 8); + } /* Some cameras fill the tag with '\0' or ' '. */ for (i = 0; i < e->size && @@ -304,9 +309,10 @@ } /* First 8 bytes need to follow the specification. */ - if (memcmp (e->data, "ASCII\0\0\0" , 8) && - memcmp (e->data, "UNICODE\0" , 8) && - memcmp (e->data, "JIS\0\0\0\0\0", 8)) { + if (memcmp (e->data, "ASCII\0\0\0" , 8) && + memcmp (e->data, "UNICODE\0" , 8) && + memcmp (e->data, "JIS\0\0\0\0\0" , 8) && + memcmp (e->data, "\0\0\0\0\0\0\0\0", 8)) { e->data = exif_entry_realloc (e, e->data, 8 + e->size); if (!e->data) { e->size = 0; |
From: Lutz M. <lu...@us...> - 2004-12-05 21:29:15
|
Update of /cvsroot/libexif/exif/exif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13171/exif Modified Files: actions.c utils.c utils.h Log Message: 2004-12-05 Lutz Mueller <lu...@us...> * exif/actions.c: Lars Ellenberg <l....@we...> found out that on his system, fprintf ("%s", NULL) does not work. * exif/exif-utils.[c,h]: Remove some unused code. Index: utils.c =================================================================== RCS file: /cvsroot/libexif/exif/exif/utils.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- utils.c 15 Dec 2002 11:39:13 -0000 1.7 +++ utils.c 5 Dec 2004 21:29:06 -0000 1.8 @@ -138,106 +138,3 @@ return (-1); } - -#ifdef HAVE_MNOTE - -MNoteTag -mnote_tag_from_string (MNoteData *note, const char *string) -{ - MNoteTag tag; - unsigned int i, number, factor; - const char *name; - - if (!string) - return (0); - - /* Is the string a tag's name or title? */ - for (tag = 0xffff; tag > 0; tag--) { - name = mnote_tag_get_name (note, tag); - if (name && !strcmp (string, name)) - return (tag); - name = mnote_tag_get_title (note, tag); - if (name && !strcmp (string, name)) - return (tag); - } - - /* Is the string a decimal number? */ - if (strspn (string, "0123456789") == strlen (string)) - return (atoi (string)); - - /* Is the string a hexadecimal number? */ - for (i = 0; i < strlen (string); i++) - if (string[i] == 'x') - break; - if (i == strlen (string)) - return (0); - - string += i + 1; - tag = 0; - for (i = strlen (string); i > 0; i--) { - switch (string[i - 1]) { - case '0': - number = 0; - break; - case '1': - number = 1; - break; - case '2': - number = 2; - break; - case '3': - number = 3; - break; - case '4': - number = 4; - break; - case '5': - number = 5; - break; - case '6': - number = 6; - break; - case '7': - number = 7; - break; - case '8': - number = 8; - break; - case '9': - number = 9; - break; - case 'a': - case 'A': - number = 10; - break; - case 'b': - case 'B': - number = 11; - break; - case 'c': - case 'C': - number = 12; - break; - case 'd': - case 'D': - number = 13; - break; - case 'e': - case 'E': - number = 14; - break; - case 'f': - case 'F': - number = 15; - break; - default: - return (0); - } - factor = 1 << ((strlen (string) - i) * 4); - tag += (number * factor); - } - - return (tag); -} - -#endif Index: utils.h =================================================================== RCS file: /cvsroot/libexif/exif/exif/utils.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- utils.h 15 Dec 2002 11:39:13 -0000 1.5 +++ utils.h 5 Dec 2004 21:29:06 -0000 1.6 @@ -24,16 +24,7 @@ #include <libexif/exif-tag.h> #include <libexif/exif-ifd.h> -#ifdef HAVE_MNOTE -#include <libmnote/mnote-data.h> -#endif - ExifTag exif_tag_from_string (const char *string); - ExifIfd exif_ifd_from_string (const char *string); -#ifdef HAVE_MNOTE -MNoteTag mnote_tag_from_string (MNoteData *note, const char *string); -#endif - #endif /* __UTILS_H__ */ Index: actions.c =================================================================== RCS file: /cvsroot/libexif/exif/exif/actions.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- actions.c 31 Aug 2004 13:33:29 -0000 1.20 +++ actions.c 5 Dec 2004 21:29:06 -0000 1.21 @@ -31,6 +31,8 @@ #define ENTRY_FOUND " * " #define ENTRY_NOT_FOUND " - " +#define CN(s) (s) ? : "(NULL)" + void action_tag_table (const char *filename, ExifData *ed) { @@ -187,9 +189,9 @@ char v[1024]; if (*ids) fprintf (stdout, "0x%04x", e->tag); - else fprintf (stdout, "%s", exif_tag_get_title (e->tag)); + else fprintf (stdout, "%s", CN (exif_tag_get_title (e->tag))); printf ("\t"); - fprintf (stdout, "%s", exif_entry_get_value (e, v, sizeof (v))); + fprintf (stdout, "%s", CN (exif_entry_get_value (e, v, sizeof (v)))); fputc ('\n', stdout); } |
From: Lutz M. <lu...@us...> - 2004-12-05 21:29:14
|
Update of /cvsroot/libexif/exif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13171 Modified Files: ChangeLog Log Message: 2004-12-05 Lutz Mueller <lu...@us...> * exif/actions.c: Lars Ellenberg <l....@we...> found out that on his system, fprintf ("%s", NULL) does not work. * exif/exif-utils.[c,h]: Remove some unused code. Index: ChangeLog =================================================================== RCS file: /cvsroot/libexif/exif/ChangeLog,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- ChangeLog 9 Sep 2004 06:28:25 -0000 1.46 +++ ChangeLog 5 Dec 2004 21:29:05 -0000 1.47 @@ -1,3 +1,9 @@ +2004-12-05 Lutz Mueller <lu...@us...> + + * exif/actions.c: Lars Ellenberg <l....@we...> found out that + on his system, fprintf ("%s", NULL) does not work. + * exif/exif-utils.[c,h]: Remove some unused code. + 2004-09-09 Lutz Mueller <lu...@us...> * exif/configure.in: We depend on libexif 0.6.11. |
From: Lutz M. <lu...@us...> - 2004-11-16 23:52:29
|
Update of /cvsroot/libexif/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8776/libexif Modified Files: exif-data.c Log Message: 2004-11-17 Lutz Mueller <lu...@us...> * libexif/exif-data.c: Make the last commit actually work. Index: exif-data.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-data.c,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- exif-data.c 15 Nov 2004 22:41:06 -0000 1.59 +++ exif-data.c 16 Nov 2004 23:52:19 -0000 1.60 @@ -355,9 +355,9 @@ return; } entry = exif_entry_new_mem (data->priv->mem); - exif_content_add_entry (ifd, entry); exif_data_load_data_entry (data, entry, d, ds, offset + 12 * i); + exif_content_add_entry (ifd, entry); exif_entry_unref (entry); break; } |
From: Lutz M. <lu...@us...> - 2004-11-16 23:52:28
|
Update of /cvsroot/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8776 Modified Files: ChangeLog Log Message: 2004-11-17 Lutz Mueller <lu...@us...> * libexif/exif-data.c: Make the last commit actually work. Index: ChangeLog =================================================================== RCS file: /cvsroot/libexif/libexif/ChangeLog,v retrieving revision 1.172 retrieving revision 1.173 diff -u -d -r1.172 -r1.173 --- ChangeLog 15 Nov 2004 22:41:05 -0000 1.172 +++ ChangeLog 16 Nov 2004 23:52:19 -0000 1.173 @@ -1,3 +1,7 @@ +2004-11-17 Lutz Mueller <lu...@us...> + + * libexif/exif-data.c: Make the last commit actually work. + 2004-11-15 Lutz Mueller <lu...@us...> * libexif/exif-content.c: Complain if the same tag is added twice |
From: Lutz M. <lu...@us...> - 2004-11-15 22:41:15
|
Update of /cvsroot/libexif/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15436/libexif Modified Files: exif-content.c exif-content.h exif-data.c Log Message: 2004-11-15 Lutz Mueller <lu...@us...> * libexif/exif-content.c: Complain if the same tag is added twice to an IFD. Suggestion by Angela Wrobel. Index: exif-data.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-data.c,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- exif-data.c 15 Nov 2004 07:09:56 -0000 1.58 +++ exif-data.c 15 Nov 2004 22:41:06 -0000 1.59 @@ -1030,10 +1030,15 @@ void exif_data_log (ExifData *data, ExifLog *log) { + unsigned int i; + if (!data || !data->priv) return; exif_log_unref (data->priv->log); data->priv->log = log; exif_log_ref (log); + + for (i = 0; i < EXIF_IFD_COUNT; i++) + exif_content_log (data->ifd[i], log); } /* Used internally within libexif */ Index: exif-content.h =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-content.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- exif-content.h 2 Oct 2004 05:55:25 -0000 1.10 +++ exif-content.h 15 Nov 2004 22:41:06 -0000 1.11 @@ -31,6 +31,7 @@ #include <libexif/exif-tag.h> #include <libexif/exif-entry.h> #include <libexif/exif-data.h> +#include <libexif/exif-log.h> #include <libexif/exif-mem.h> struct _ExifContent @@ -65,7 +66,8 @@ (exif_content_get_entry (c,t) ? \ exif_entry_get_value (exif_content_get_entry (c,t),v,m) : NULL) -void exif_content_dump (ExifContent *content, unsigned int indent); +void exif_content_dump (ExifContent *content, unsigned int indent); +void exif_content_log (ExifContent *content, ExifLog *log); #ifdef __cplusplus } Index: exif-content.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-content.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- exif-content.c 10 Nov 2004 18:53:39 -0000 1.14 +++ exif-content.c 15 Nov 2004 22:41:05 -0000 1.15 @@ -33,6 +33,7 @@ unsigned int ref_count; ExifMem *mem; + ExifLog *log; }; ExifContent * @@ -88,19 +89,22 @@ void exif_content_free (ExifContent *content) { + ExifMem *mem = (content && content->priv) ? content->priv->mem : NULL; unsigned int i; if (!content) return; for (i = 0; i < content->count; i++) exif_entry_unref (content->entries[i]); + exif_mem_free (mem, content->entries); + if (content->priv) { - ExifMem *mem = content->priv->mem; - exif_mem_free (mem, content->entries); - exif_mem_free (mem, content->priv); - exif_mem_free (mem, content); - exif_mem_unref (mem); + exif_log_unref (content->priv->log); } + + exif_mem_free (mem, content->priv); + exif_mem_free (mem, content); + exif_mem_unref (mem); } void @@ -123,17 +127,26 @@ } void -exif_content_add_entry (ExifContent *content, ExifEntry *entry) +exif_content_add_entry (ExifContent *c, ExifEntry *entry) { - if (!content || !content->priv || !entry || entry->parent) return; + if (!c || !c->priv || !entry || entry->parent) return; - entry->parent = content; - content->entries = exif_mem_realloc (content->priv->mem, - content->entries, sizeof (ExifEntry) * (content->count + 1)); - if (!content->entries) return; - content->entries[content->count] = entry; + /* One tag can only be added once to an IFD. */ + if (exif_content_get_entry (c, entry->tag)) { + exif_log (c->priv->log, EXIF_LOG_CODE_DEBUG, "ExifContent", + "An attempt has been made to add " + "the tag '%s' twice to an IFD. This is against " + "specification.", exif_tag_get_name (entry->tag)); + return; + } + + entry->parent = c; + c->entries = exif_mem_realloc (c->priv->mem, + c->entries, sizeof (ExifEntry) * (c->count + 1)); + if (!c->entries) return; + c->entries[c->count] = entry; exif_entry_ref (entry); - content->count++; + c->count++; } void @@ -183,3 +196,14 @@ for (i = 0; i < content->count; i++) func (content->entries[i], data); } + +void +exif_content_log (ExifContent *content, ExifLog *log) +{ + if (!content || !content->priv || !log || content->priv->log == log) + return; + + if (content->priv->log) exif_log_unref (content->priv->log); + content->priv->log = log; + exif_log_ref (log); +} |
From: Lutz M. <lu...@us...> - 2004-11-15 22:41:15
|
Update of /cvsroot/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15436 Modified Files: ChangeLog Log Message: 2004-11-15 Lutz Mueller <lu...@us...> * libexif/exif-content.c: Complain if the same tag is added twice to an IFD. Suggestion by Angela Wrobel. Index: ChangeLog =================================================================== RCS file: /cvsroot/libexif/libexif/ChangeLog,v retrieving revision 1.171 retrieving revision 1.172 diff -u -d -r1.171 -r1.172 --- ChangeLog 15 Nov 2004 07:09:56 -0000 1.171 +++ ChangeLog 15 Nov 2004 22:41:05 -0000 1.172 @@ -1,5 +1,10 @@ 2004-11-15 Lutz Mueller <lu...@us...> + * libexif/exif-content.c: Complain if the same tag is added twice + to an IFD. Suggestion by Angela Wrobel. + +2004-11-15 Lutz Mueller <lu...@us...> + * libexif/exif-data.c: Additional debugging message if specification is violated. |
From: Lutz M. <lu...@us...> - 2004-11-15 07:10:07
|
Update of /cvsroot/libexif/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20740/libexif Modified Files: exif-data.c Log Message: 2004-11-15 Lutz Mueller <lu...@us...> * libexif/exif-data.c: Additional debugging message if specification is violated. Index: exif-data.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-data.c,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- exif-data.c 14 Nov 2004 21:56:00 -0000 1.57 +++ exif-data.c 15 Nov 2004 07:09:56 -0000 1.58 @@ -265,6 +265,14 @@ "'%s' detected. Skipping...", \ exif_ifd_get_name (i)); \ break; \ +} \ +if (data->ifd[(i)]->count) { \ + exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, \ + "ExifData", "Attemt to load IFD " \ + "'%s' multiple times detected. " \ + "Skipping...", \ + exif_ifd_get_name (i)); \ + break; \ } static void |
From: Lutz M. <lu...@us...> - 2004-11-15 07:10:07
|
Update of /cvsroot/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20740 Modified Files: ChangeLog Log Message: 2004-11-15 Lutz Mueller <lu...@us...> * libexif/exif-data.c: Additional debugging message if specification is violated. Index: ChangeLog =================================================================== RCS file: /cvsroot/libexif/libexif/ChangeLog,v retrieving revision 1.170 retrieving revision 1.171 diff -u -d -r1.170 -r1.171 --- ChangeLog 14 Nov 2004 21:55:39 -0000 1.170 +++ ChangeLog 15 Nov 2004 07:09:56 -0000 1.171 @@ -1,3 +1,8 @@ +2004-11-15 Lutz Mueller <lu...@us...> + + * libexif/exif-data.c: Additional debugging message if + specification is violated. + 2004-11-14 Lutz Mueller <lu...@us...> * libexif/*: Plug another few memleaks. All found by Angala Wrobel. |
From: Lutz M. <lu...@us...> - 2004-11-14 21:56:10
|
Update of /cvsroot/libexif/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8961/libexif Modified Files: exif-data.c exif-mnote-data.c Log Message: 2004-11-14 Lutz Mueller <lu...@us...> * libexif/*: Plug another few memleaks. All found by Angala Wrobel. Index: exif-mnote-data.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-mnote-data.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- exif-mnote-data.c 11 Nov 2004 20:33:12 -0000 1.10 +++ exif-mnote-data.c 14 Nov 2004 21:56:00 -0000 1.11 @@ -62,7 +62,7 @@ exif_mem_free (mem, d->priv); d->priv = NULL; } - d->mem = NULL; + exif_log_unref (d->log); exif_mem_free (mem, d); exif_mem_unref (mem); } Index: exif-data.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-data.c,v retrieving revision 1.56 retrieving revision 1.57 diff -u -d -r1.56 -r1.57 --- exif-data.c 12 Nov 2004 07:46:08 -0000 1.56 +++ exif-data.c 14 Nov 2004 21:56:00 -0000 1.57 @@ -169,7 +169,6 @@ memcpy (entry->data, d + doff, s); } -#ifndef EXIF_DONT_CHANGE_MAKER_NOTE /* If this is the MakerNote, remember the offset */ if (entry->tag == EXIF_TAG_MAKER_NOTE) { if (entry->size > 6) exif_log (data->priv->log, @@ -181,7 +180,6 @@ entry->data[6]); data->priv->offset_mnote = doff; } -#endif exif_entry_fix (entry); } @@ -204,6 +202,7 @@ exif_set_short (*d + 6 + offset + 2, data->priv->order, (ExifShort) e->format); +#ifndef EXIF_DONT_CHANGE_MAKER_NOTE /* If this is the maker note tag, update it. */ if ((e->tag == EXIF_TAG_MAKER_NOTE) && data->priv->md) { exif_mem_free (data->priv->mem, e->data); @@ -213,6 +212,7 @@ exif_mnote_data_save (data->priv->md, &e->data, &e->size); e->components = e->size; } +#endif exif_set_long (*d + 6 + offset + 4, data->priv->order, e->components); @@ -826,12 +826,10 @@ void exif_data_unref (ExifData *data) { - if (!data) - return; + if (!data) return; data->priv->ref_count--; - if (!data->priv->ref_count) - exif_data_free (data); + if (!data->priv->ref_count) exif_data_free (data); } void @@ -855,6 +853,10 @@ } if (data->priv) { + if (data->priv->log) { + exif_log_unref (data->priv->log); + data->priv->log = NULL; + } if (data->priv->md) { exif_mnote_data_unref (data->priv->md); data->priv->md = NULL; |
From: Lutz M. <lu...@us...> - 2004-11-14 21:55:48
|
Update of /cvsroot/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8904 Modified Files: ChangeLog Log Message: 2004-11-14 Lutz Mueller <lu...@us...> * libexif/*: Plug another few memleaks. All found by Angala Wrobel. Index: ChangeLog =================================================================== RCS file: /cvsroot/libexif/libexif/ChangeLog,v retrieving revision 1.169 retrieving revision 1.170 diff -u -d -r1.169 -r1.170 --- ChangeLog 12 Nov 2004 07:46:07 -0000 1.169 +++ ChangeLog 14 Nov 2004 21:55:39 -0000 1.170 @@ -1,3 +1,7 @@ +2004-11-14 Lutz Mueller <lu...@us...> + + * libexif/*: Plug another few memleaks. All found by Angala Wrobel. + 2004-11-12 Lutz Mueller <lu...@us...> * libexif/exif-data.c: Clean up handling of MakerNote tags. |
From: Jan P. <pa...@us...> - 2004-11-12 11:33:35
|
Update of /cvsroot/libexif/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32727 Modified Files: exif-tag.c Log Message: #include <string.h> because of strcmp Index: exif-tag.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-tag.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- exif-tag.c 10 Nov 2004 18:53:39 -0000 1.20 +++ exif-tag.c 12 Nov 2004 11:33:13 -0000 1.21 @@ -24,6 +24,7 @@ #include <libexif/i18n.h> #include <stdlib.h> +#include <string.h> typedef enum { ESL_MANDATORY = 1, /* Mandatory */ |
From: Lutz M. <lu...@us...> - 2004-11-12 07:46:19
|
Update of /cvsroot/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18373 Modified Files: ChangeLog Log Message: 2004-11-12 Lutz Mueller <lu...@us...> * libexif/exif-data.c: Clean up handling of MakerNote tags. Index: ChangeLog =================================================================== RCS file: /cvsroot/libexif/libexif/ChangeLog,v retrieving revision 1.168 retrieving revision 1.169 diff -u -d -r1.168 -r1.169 --- ChangeLog 11 Nov 2004 20:33:10 -0000 1.168 +++ ChangeLog 12 Nov 2004 07:46:07 -0000 1.169 @@ -1,3 +1,7 @@ +2004-11-12 Lutz Mueller <lu...@us...> + + * libexif/exif-data.c: Clean up handling of MakerNote tags. + 2004-11-11 Lutz Mueller <lu...@us...> * libexif/exif-mnote-data.c: Plug yet another memory leak. |
From: Lutz M. <lu...@us...> - 2004-11-12 07:46:19
|
Update of /cvsroot/libexif/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18373/libexif Modified Files: exif-data.c Log Message: 2004-11-12 Lutz Mueller <lu...@us...> * libexif/exif-data.c: Clean up handling of MakerNote tags. Index: exif-data.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-data.c,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- exif-data.c 10 Nov 2004 18:53:39 -0000 1.55 +++ exif-data.c 12 Nov 2004 07:46:08 -0000 1.56 @@ -549,6 +549,49 @@ exif_set_long (*d + 6 + offset, data->priv->order, 0); } +typedef enum { + EXIF_DATA_TYPE_MAKER_NOTE_NONE = 0, + EXIF_DATA_TYPE_MAKER_NOTE_CANON = 1, + EXIF_DATA_TYPE_MAKER_NOTE_OLYMPUS = 2, + EXIF_DATA_TYPE_MAKER_NOTE_PENTAX = 3 +} ExifDataTypeMakerNote; + +static ExifDataTypeMakerNote +exif_data_get_type_maker_note (ExifData *d) +{ + ExifEntry *e, *em; + char value[1024]; + + if (!d) return EXIF_DATA_TYPE_MAKER_NOTE_NONE; + + e = exif_data_get_entry (d, EXIF_TAG_MAKER_NOTE); + if (!e) return EXIF_DATA_TYPE_MAKER_NOTE_NONE; + + /* Olympus & Nikon */ + if ((e->size >= 5) && (!memcmp (e->data, "OLYMP", 5) || + !memcmp (e->data, "Nikon", 5))) + return EXIF_DATA_TYPE_MAKER_NOTE_OLYMPUS; + + em = exif_data_get_entry (d, EXIF_TAG_MAKE); + if (!em) return EXIF_DATA_TYPE_MAKER_NOTE_NONE; + + /* Canon */ + if (!strcmp (exif_entry_get_value (em, value, sizeof(value)), "Canon")) + return EXIF_DATA_TYPE_MAKER_NOTE_CANON; + + /* Pentax & some variant of Nikon */ + if ((e->size >= 2) && (e->data[0] == 0x00) && (e->data[1] == 0x1b)) { + if (!strncasecmp ( + exif_entry_get_value (em, value, sizeof(value)), + "Nikon", 5)) + return EXIF_DATA_TYPE_MAKER_NOTE_OLYMPUS; + else + return EXIF_DATA_TYPE_MAKER_NOTE_PENTAX; + } + + return EXIF_DATA_TYPE_MAKER_NOTE_NONE; +} + void exif_data_load_data (ExifData *data, const unsigned char *d_orig, unsigned int ds_orig) @@ -556,7 +599,6 @@ unsigned int l; ExifLong offset; ExifShort n; - ExifEntry *e, *em; const unsigned char *d = d_orig; unsigned int ds = ds_orig, len; @@ -692,46 +734,30 @@ * space between IFDs. Here is the only place where we have access * to that data. */ - e = exif_data_get_entry (data, EXIF_TAG_MAKER_NOTE); - if (e) { - - /* Olympus & Nikon */ - if ((e->size >= 5) && (!memcmp (e->data, "OLYMP", 5) || - !memcmp (e->data, "Nikon", 5))) { - data->priv->md = exif_mnote_data_olympus_new (data->priv->mem); - } else { - char value[7]; - em = exif_data_get_entry (data, EXIF_TAG_MAKE); - /* Pentax & some variant of Nikon */ - if ((e->size >= 2) && (e->data[0] == 0x00) - && (e->data[1] == 0x1b)) { - if (em && !strncasecmp (exif_entry_get_value (em, value, sizeof(value)), "Nikon", 5)) { - data->priv->md = exif_mnote_data_olympus_new (data->priv->mem); - } else { - data->priv->md = exif_mnote_data_pentax_new (data->priv->mem); - } - - } else { - /* Canon */ - if (em) { - - if (!strcmp (exif_entry_get_value (em, value, sizeof(value)), "Canon")) - data->priv->md = exif_mnote_data_canon_new (data->priv->mem); - } - } - } + switch (exif_data_get_type_maker_note (data)) { + case EXIF_DATA_TYPE_MAKER_NOTE_OLYMPUS: + data->priv->md = exif_mnote_data_olympus_new (data->priv->mem); + break; + case EXIF_DATA_TYPE_MAKER_NOTE_PENTAX: + data->priv->md = exif_mnote_data_pentax_new (data->priv->mem); + break; + case EXIF_DATA_TYPE_MAKER_NOTE_CANON: + data->priv->md = exif_mnote_data_canon_new (data->priv->mem); + break; + default: + break; + } - /* - * If we are able to interpret the maker note, do so. - */ - if (data->priv->md) { - exif_mnote_data_log (data->priv->md, data->priv->log); - exif_mnote_data_set_byte_order (data->priv->md, - data->priv->order); - exif_mnote_data_set_offset (data->priv->md, - data->priv->offset_mnote); - exif_mnote_data_load (data->priv->md, d, ds); - } + /* + * If we are able to interpret the maker note, do so. + */ + if (data->priv->md) { + exif_mnote_data_log (data->priv->md, data->priv->log); + exif_mnote_data_set_byte_order (data->priv->md, + data->priv->order); + exif_mnote_data_set_offset (data->priv->md, + data->priv->offset_mnote); + exif_mnote_data_load (data->priv->md, d, ds); } } |
From: Lutz M. <lu...@us...> - 2004-11-11 20:33:21
|
Update of /cvsroot/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6981 Modified Files: ChangeLog Log Message: 2004-11-11 Lutz Mueller <lu...@us...> * libexif/exif-mnote-data.c: Plug yet another memory leak. Detected by Angela Wrobel. Index: ChangeLog =================================================================== RCS file: /cvsroot/libexif/libexif/ChangeLog,v retrieving revision 1.167 retrieving revision 1.168 diff -u -d -r1.167 -r1.168 --- ChangeLog 11 Nov 2004 20:24:38 -0000 1.167 +++ ChangeLog 11 Nov 2004 20:33:10 -0000 1.168 @@ -1,5 +1,10 @@ 2004-11-11 Lutz Mueller <lu...@us...> + * libexif/exif-mnote-data.c: Plug yet another memory leak. + Detected by Angela Wrobel. + +2004-11-11 Lutz Mueller <lu...@us...> + * libexif/exif-log.c: Plug another memory leak. Detected by Angela Wrobel. |
From: Lutz M. <lu...@us...> - 2004-11-11 20:33:21
|
Update of /cvsroot/libexif/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6981/libexif Modified Files: exif-entry.c exif-mnote-data.c Log Message: 2004-11-11 Lutz Mueller <lu...@us...> * libexif/exif-mnote-data.c: Plug yet another memory leak. Detected by Angela Wrobel. Index: exif-mnote-data.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-mnote-data.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- exif-mnote-data.c 10 Nov 2004 18:53:39 -0000 1.9 +++ exif-mnote-data.c 11 Nov 2004 20:33:12 -0000 1.10 @@ -54,14 +54,17 @@ static void exif_mnote_data_free (ExifMnoteData *d) { + ExifMem *mem = d ? d->mem : NULL; + if (!d) return; if (d->priv) { if (d->methods.free) d->methods.free (d); - exif_mem_free (d->mem, d->priv); + exif_mem_free (mem, d->priv); d->priv = NULL; } - exif_mem_unref (d->mem); d->mem = NULL; + exif_mem_free (mem, d); + exif_mem_unref (mem); } void Index: exif-entry.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-entry.c,v retrieving revision 1.71 retrieving revision 1.72 diff -u -d -r1.71 -r1.72 --- exif-entry.c 10 Nov 2004 18:53:39 -0000 1.71 +++ exif-entry.c 11 Nov 2004 20:33:11 -0000 1.72 @@ -678,7 +678,8 @@ (strlen ((char *) e->data) + 1 < e->size) && (strspn (e->data, " ") != strlen ((char *) e->data))) strncat (val, e->data + strlen (e->data) + 1, - maxlen - strlen (val)); + MIN (maxlen - strlen (val), + e->size - (strlen (e->data) + 1))); else strncat (val, _("[None]"), maxlen - strlen (val)); strncat (val, " ", maxlen - strlen (val)); |