update libexif

Signed-off-by: zhanglitao <zhanglitao11@huawei.com>
This commit is contained in:
zhanglitao
2023-05-19 12:07:34 +08:00
committed by duanhan
parent 85d8ce9924
commit 871724f4ab
52 changed files with 1014 additions and 125 deletions
+10
View File
@@ -9,6 +9,7 @@ if (defined(ohos_lite)) { # is on lite Os for ipcamera
"//third_party/libexif/libexif",
"//third_party/libexif/libexif/pentax",
"//third_party/libexif/libexif/olympus",
"//third_party/libexif/libexif/apple",
"//third_party/libexif/libexif/canon",
"//third_party/libexif/libexif/fuji",
"//third_party/libexif/libexif/apple",
@@ -21,6 +22,7 @@ if (defined(ohos_lite)) { # is on lite Os for ipcamera
"//third_party/libexif/libexif/exif-data.c",
"//third_party/libexif/libexif/exif-entry.c",
"//third_party/libexif/libexif/exif-format.c",
"//third_party/libexif/libexif/exif-gps-ifd.c",
"//third_party/libexif/libexif/exif-ifd.c",
"//third_party/libexif/libexif/exif-loader.c",
"//third_party/libexif/libexif/exif-log.c",
@@ -37,6 +39,9 @@ if (defined(ohos_lite)) { # is on lite Os for ipcamera
"//third_party/libexif/libexif/fuji/exif-mnote-data-fuji.c",
"//third_party/libexif/libexif/fuji/mnote-fuji-entry.c",
"//third_party/libexif/libexif/fuji/mnote-fuji-tag.c",
"//third_party/libexif/libexif/apple/exif-mnote-data-apple.c",
"//third_party/libexif/libexif/apple/mnote-apple-entry.c",
"//third_party/libexif/libexif/apple/mnote-apple-tag.c",
"//third_party/libexif/libexif/canon/exif-mnote-data-canon.c",
"//third_party/libexif/libexif/canon/mnote-canon-entry.c",
"//third_party/libexif/libexif/canon/mnote-canon-tag.c",
@@ -77,6 +82,9 @@ if (defined(ohos_lite)) { # is on lite Os for ipcamera
ohos_source_set("exif_static") {
sources = [
"//third_party/libexif/libexif/apple/exif-mnote-data-apple.c",
"//third_party/libexif/libexif/apple/mnote-apple-entry.c",
"//third_party/libexif/libexif/apple/mnote-apple-tag.c",
"//third_party/libexif/libexif/canon/exif-mnote-data-canon.c",
"//third_party/libexif/libexif/canon/mnote-canon-entry.c",
"//third_party/libexif/libexif/canon/mnote-canon-tag.c",
@@ -85,6 +93,7 @@ if (defined(ohos_lite)) { # is on lite Os for ipcamera
"//third_party/libexif/libexif/exif-data.c",
"//third_party/libexif/libexif/exif-entry.c",
"//third_party/libexif/libexif/exif-format.c",
"//third_party/libexif/libexif/exif-gps-ifd.c",
"//third_party/libexif/libexif/exif-ifd.c",
"//third_party/libexif/libexif/exif-loader.c",
"//third_party/libexif/libexif/exif-log.c",
@@ -107,6 +116,7 @@ if (defined(ohos_lite)) { # is on lite Os for ipcamera
"//third_party/libexif/libexif",
"//third_party/libexif/libexif/pentax",
"//third_party/libexif/libexif/olympus",
"//third_party/libexif/libexif/apple",
"//third_party/libexif/libexif/canon",
"//third_party/libexif/libexif/fuji",
"//third_party/libexif/libexif/apple",
+1 -1
View File
@@ -73,7 +73,7 @@
<filefilter name="binaryFileTypePolicyFilter" desc="Filters for binary file policies">
<filteritem type="filepath" name=".*" desc="third party"/>
</filefilter>
<filefilter name="defaultPolicyFilter" desc="Filters for compatibilitylicense header policies">
<filefilter name="defaultPolicyFilter" desc="Filters for compatibility, license header policies">
<filteritem type="filename" name="Makefile.am" desc="programmer defined file"/>
<filteritem type="filepath" name="po/.*" desc="portable object file"/>
</filefilter>
+3 -14
View File
@@ -41,8 +41,9 @@ the results available at https://libexif.github.io/api/
The short test programs in the test directory illustrates how to create
valid EXIF data from scratch, how to save EXIF data and how to load EXIF
data from data in memory. There are also a few simple example programs
available in the contrib/examples/ directory. Don't hesitate to contact
data from data in memory. To run the test programs, just run make check.
There are also a few simple example programs available in the
contrib/examples/ directory. Don't hesitate to contact
us at <libexif-devel@lists.sourceforge.net> if you have any questions
on how to use libexif.
@@ -94,18 +95,6 @@ to build. Building from the source tar ball usually involves the commands:
When building from source out of git, something like the following will be
necessary:
gettextize
mv po/Makevars.template po/Makevars
aclocal -I auto-m4 -I m4m
autoheader
libtoolize --force
automake --add-missing
autoconf
./configure
make
Or, probably just:
autoreconf -i
./configure
make
+2 -2
View File
@@ -3,8 +3,8 @@
"Name": "libexif",
"License": "LGPL-2.1+",
"License File": "COPYING",
"Version Number": "0.6.22",
"Upstream URL": "https://github.com/libexif/libexif/releases/tag/v0.6.22",
"Version Number": "0.6.24",
"Upstream URL": "https://github.com/libexif/libexif/releases/tag/v0.6.24",
"Description": "The exif base library"
}
]
+1 -1
View File
@@ -40,4 +40,4 @@ Crashes caused by debugging functionality are not in scope.
Bugreports can be filed as github issues.
If you want to report an embargoed security bug report, reach out to dan@coneharvesters.com.
If you want to report an embargoed security bug report, reach out to dan@coneharvesters.com and marcus@jet.franken.de.
+3 -3
View File
@@ -64,7 +64,7 @@
#define PACKAGE_NAME "EXIF library"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "EXIF library 0.6.22.1"
#define PACKAGE_STRING "EXIF library 0.6.24.1"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "libexif"
@@ -73,13 +73,13 @@
#define PACKAGE_URL ""
/* Define to the version of this package. */
#define PACKAGE_VERSION "0.6.22.1"
#define PACKAGE_VERSION "0.6.24.1"
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Version number of package */
#define VERSION "0.6.22.1"
#define VERSION "0.6.24.1"
/* Enable large inode numbers on Mac OS X 10.5. */
#ifndef _DARWIN_USE_64_BIT_INODE
+6
View File
@@ -0,0 +1,6 @@
Makefile
Makefile.in
.deps
.libs
*.la
*.lo
+7
View File
@@ -0,0 +1,7 @@
# -*- Makefile -*-
noinst_LTLIBRARIES += libmnote-apple.la
libmnote_apple_la_SOURCES = \
apple/mnote-apple-entry.c apple/mnote-apple-entry.h \
apple/exif-mnote-data-apple.c apple/exif-mnote-data-apple.h \
apple/mnote-apple-tag.c apple/mnote-apple-tag.h
libmnote_apple_la_LIBADD = $(LTLIBINTL)
+301
View File
@@ -0,0 +1,301 @@
/* exif-mnote-data-apple.c
*
* Copyright (c) 2018 zhanwang-sky <zhanwang_sky@163.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*/
#include <config.h>
#include "exif-mnote-data-apple.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <libexif/exif-data.h>
#include <libexif/exif-utils.h>
static void
exif_mnote_data_apple_free(ExifMnoteData *md) {
ExifMnoteDataApple *d = (ExifMnoteDataApple *) md;
unsigned int i;
/*printf("%s\n", __FUNCTION__);*/
if (!d) {
return;
}
if (d->entries) {
for (i = 0; i < d->count; i++) {
if (d->entries[i].data) {
exif_mem_free(md->mem, d->entries[i].data);
}
}
exif_mem_free(md->mem, d->entries);
d->entries = NULL;
d->count = 0;
}
return;
}
static void
exif_mnote_data_apple_load(ExifMnoteData *md, const unsigned char *buf, unsigned int buf_size) {
ExifMnoteDataApple *d = (ExifMnoteDataApple *) md;
unsigned int tcount, i;
unsigned int dsize;
unsigned int ofs, dofs;
/*printf("%s\n", __FUNCTION__);*/
if (!d || !buf || (buf_size < 6 + 16)) {
exif_log(md->log, EXIF_LOG_CODE_CORRUPT_DATA,
"ExifMnoteDataApple", "Short MakerNote");
return;
}
/* Start of interesting data */
ofs = d->offset + 6;
if (ofs > buf_size - 16) {
exif_log(md->log, EXIF_LOG_CODE_CORRUPT_DATA,
"ExifMnoteDataApple", "Short MakerNote");
return;
}
if ((buf[ofs + 12] == 'M') && (buf[ofs + 13] == 'M')) {
d->order = EXIF_BYTE_ORDER_MOTOROLA;
} else if ((buf[ofs + 12] == 'I') && (buf[ofs + 13] == 'I')) {
d->order = EXIF_BYTE_ORDER_INTEL;
} else {
exif_log(md->log, EXIF_LOG_CODE_CORRUPT_DATA,
"ExifMnoteDataApple", "Unrecognized byte order");
/*printf("%s(%d)\n", __FUNCTION__, __LINE__);*/
return;
}
tcount = (unsigned int) exif_get_short(buf + ofs + 14, d->order);
/* Sanity check the offset */
if (buf_size < d->offset + 6 + 16 + tcount * 12 + 4) {
exif_log(md->log, EXIF_LOG_CODE_CORRUPT_DATA,
"ExifMnoteDataApple", "Short MakerNote");
/*printf("%s(%d)\n", __FUNCTION__, __LINE__);*/
return;
}
/* printf("%s(%d): total %d tags\n", __FUNCTION__, __LINE__, tcount); */
ofs += 16;
exif_mnote_data_apple_free(md);
/* Reserve enough space for all the possible MakerNote tags */
d->entries = exif_mem_alloc(md->mem, sizeof(MnoteAppleEntry) * tcount);
if (!d->entries) {
EXIF_LOG_NO_MEMORY(md->log, "ExifMnoteApple", sizeof(MnoteAppleEntry) * tcount);
/*printf("%s(%d)\n", __FUNCTION__, __LINE__);*/
return;
}
memset(d->entries, 0, sizeof(MnoteAppleEntry) * tcount);
for (i = 0; i < tcount; i++) {
if (ofs + 12 > buf_size) {
exif_log (md->log, EXIF_LOG_CODE_CORRUPT_DATA,
"ExifMnoteApplet", "Tag size overflow detected (%u vs size %u)", ofs + 12, buf_size);
break;
}
d->entries[i].tag = exif_get_short(buf + ofs, d->order);
d->entries[i].format = exif_get_short(buf + ofs + 2, d->order);
d->entries[i].components = exif_get_long(buf + ofs + 4, d->order);
d->entries[i].order = d->order;
if ((d->entries[i].components) && (buf_size / d->entries[i].components < exif_format_get_size(d->entries[i].format))) {
exif_log (md->log, EXIF_LOG_CODE_CORRUPT_DATA,
"ExifMnoteApplet", "Tag size overflow detected (components %lu vs size %u)", d->entries[i].components, buf_size);
break;
}
dsize = exif_format_get_size(d->entries[i].format) * d->entries[i].components;
if ((dsize > 65536) || (dsize > buf_size)) {
/* Corrupt data: EXIF data size is limited to the
* maximum size of a JPEG segment (64 kb).
*/
break;
}
if (dsize > 4) {
dofs = d->offset + exif_get_long(buf + ofs + 8, d->order);
} else {
dofs = ofs + 8;
}
if (dofs > buf_size) {
exif_log (md->log, EXIF_LOG_CODE_CORRUPT_DATA,
"ExifMnoteApplet", "Tag size overflow detected (%u vs size %u)", dofs, buf_size);
continue;
}
ofs += 12;
d->entries[i].data = exif_mem_alloc(md->mem, dsize);
if (!d->entries[i].data) {
EXIF_LOG_NO_MEMORY(md->log, "ExifMnoteApple", dsize);
continue;
}
if (dofs + dsize > buf_size) {
exif_log (md->log, EXIF_LOG_CODE_CORRUPT_DATA,
"ExifMnoteApplet", "Tag size overflow detected (%u vs size %u)", dofs + dsize, buf_size);
continue;
}
memcpy(d->entries[i].data, buf + dofs, dsize);
d->entries[i].size = dsize;
}
d->count = tcount;
return;
}
static void
exif_mnote_data_apple_set_offset(ExifMnoteData *md, unsigned int o) {
/*printf("%s\n", __FUNCTION__);*/
if (md) {
((ExifMnoteDataApple *) md)->offset = o;
}
return;
}
static void
exif_mnote_data_apple_set_byte_order(ExifMnoteData *md , ExifByteOrder o) {
ExifMnoteDataApple *d = (ExifMnoteDataApple *) md;
unsigned int i;
/*printf("%s\n", __FUNCTION__);*/
if (!d || d->order == o) {
return;
}
for (i = 0; i < d->count; i++) {
if (d->entries[i].components && (d->entries[i].size/d->entries[i].components < exif_format_get_size (d->entries[i].format)))
continue;
exif_array_set_byte_order(d->entries[i].format, d->entries[i].data,
d->entries[i].components, d->entries[i].order, o);
d->entries[i].order = o;
}
d->order = o;
return;
}
static unsigned int
exif_mnote_data_apple_count(ExifMnoteData *md){
/*printf("%s\n", __FUNCTION__);*/
return md ? ((ExifMnoteDataApple *) md)->count : 0;
}
static unsigned int
exif_mnote_data_apple_get_id(ExifMnoteData *md, unsigned int i) {
ExifMnoteDataApple *d = (ExifMnoteDataApple *) md;
if (!d || (d->count <= i)) {
return 0;
}
return d->entries[i].tag;
}
static const char *
exif_mnote_data_apple_get_name(ExifMnoteData *md, unsigned int i) {
ExifMnoteDataApple *d = (ExifMnoteDataApple *) md;
if (!d || (d->count <= i)) {
return NULL;
}
return mnote_apple_tag_get_name(d->entries[i].tag);
}
static const char *
exif_mnote_data_apple_get_title(ExifMnoteData *md, unsigned int i) {
ExifMnoteDataApple *d = (ExifMnoteDataApple *) md;
if (!d || (d->count <= i)) {
return NULL;
}
return mnote_apple_tag_get_title(d->entries[i].tag);
}
static const char *
exif_mnote_data_apple_get_description(ExifMnoteData *md, unsigned int i) {
ExifMnoteDataApple *d = (ExifMnoteDataApple *) md;
if (!d || (d->count <= i)) {
return NULL;
}
return mnote_apple_tag_get_description(d->entries[i].tag);
}
static char *
exif_mnote_data_apple_get_value(ExifMnoteData *md, unsigned int i, char *val, unsigned int maxlen) {
ExifMnoteDataApple *d = (ExifMnoteDataApple *) md;
if (!val || !d || (d->count <= i)) {
return NULL;
}
return mnote_apple_entry_get_value(&d->entries[i], val, maxlen);
}
int
exif_mnote_data_apple_identify(const ExifData *ed, const ExifEntry *e) {
(void) ed;
if (e->size < strlen("Apple iOS")+1)
return 0;
return !memcmp((const char *) e->data, "Apple iOS", strlen("Apple iOS"));
}
ExifMnoteData *
exif_mnote_data_apple_new(ExifMem *mem) {
ExifMnoteData *md;
/*printf("%s\n", __FUNCTION__);*/
if (!mem) {
return NULL;
}
md = exif_mem_alloc(mem, sizeof(ExifMnoteDataApple));
if (!md) {
return NULL;
}
exif_mnote_data_construct(md, mem);
md->methods.free = exif_mnote_data_apple_free;
md->methods.load = exif_mnote_data_apple_load;
md->methods.set_offset = exif_mnote_data_apple_set_offset;
md->methods.set_byte_order = exif_mnote_data_apple_set_byte_order;
md->methods.count = exif_mnote_data_apple_count;
md->methods.get_id = exif_mnote_data_apple_get_id;
md->methods.get_name = exif_mnote_data_apple_get_name;
md->methods.get_title = exif_mnote_data_apple_get_title;
md->methods.get_description = exif_mnote_data_apple_get_description;
md->methods.get_value = exif_mnote_data_apple_get_value;
return md;
}
+44
View File
@@ -0,0 +1,44 @@
/* mnote-apple-data.h
*
* Copyright (c) 2018 zhanwang-sky <zhanwang_sky@163.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*/
#ifndef LIBEXIF_EXIF_MNOTE_DATA_APPLE_H
#define LIBEXIF_EXIF_MNOTE_DATA_APPLE_H
#include <libexif/exif-byte-order.h>
#include <libexif/exif-data.h>
#include <libexif/exif-mem.h>
#include <libexif/exif-mnote-data-priv.h>
#include <libexif/apple/mnote-apple-entry.h>
typedef struct _ExifMnoteDataApple ExifMnoteDataApple;
struct _ExifMnoteDataApple {
ExifMnoteData parent;
ExifByteOrder order;
unsigned int offset;
MnoteAppleEntry *entries;
unsigned int count;
};
int exif_mnote_data_apple_identify(const ExifData *, const ExifEntry *);
ExifMnoteData *exif_mnote_data_apple_new(ExifMem *);
#endif /* !defined(LIBEXIF_EXIF_MNOTE_DATA_APPLE_H) */
+159
View File
@@ -0,0 +1,159 @@
/* mnote-apple-entry.c
*
* Copyright (c) 2018 zhanwang-sky <zhanwang_sky@163.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*/
#include <config.h>
#include "mnote-apple-entry.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <libexif/exif-entry.h>
#include <libexif/exif-format.h>
#include <libexif/exif-utils.h>
#include <libexif/i18n.h>
char *
mnote_apple_entry_get_value(MnoteAppleEntry *entry, char *v, unsigned int maxlen) {
ExifLong vl;
ExifSLong vsl;
ExifShort vs;
ExifSShort vss;
ExifRational vr;
ExifSRational vsr;
size_t size;
unsigned char *data;
if (!entry)
return NULL;
memset(v, 0, maxlen);
maxlen--;
size = entry->size;
data = entry->data;
switch (entry->tag) {
case MNOTE_APPLE_TAG_HDR:
if (size < 4) return NULL;
if (entry->format != EXIF_FORMAT_SLONG) return NULL;
if (entry->components != 1) return NULL;
vsl = exif_get_slong(data, entry->order);
snprintf(v, maxlen, "%d", vsl);
break;
case MNOTE_APPLE_TAG_IMAGE_UNIQUE_ID:
case MNOTE_APPLE_TAG_BURST_UUID:
case MNOTE_APPLE_TAG_MEDIA_GROUP_UUID:
if (entry->format != EXIF_FORMAT_ASCII) return NULL;
strncpy (v, (char *) data, MIN (maxlen-1, size));
v[MIN (maxlen-1, size)] = 0;
break;
default:
switch (entry->format) {
case EXIF_FORMAT_ASCII:
strncpy (v, (char *)data, MIN(maxlen, size));
break;
case EXIF_FORMAT_SHORT: {
size_t i, len = 0;
for(i=0; i<entry->components; i++) {
if (size < 2)
break;
if (len > maxlen)
break;
vs = exif_get_short (data, entry->order);
snprintf (v+len, maxlen-len, "%hu ", vs);
len = strlen(v);
data += 2;
size -= 2;
}
}
break;
case EXIF_FORMAT_SSHORT: {
size_t i, len = 0;
for(i=0; i<entry->components; i++) {
if (size < 2)
break;
if (len > maxlen)
break;
vss = exif_get_sshort (data, entry->order);
snprintf (v+len, maxlen-len, "%hi ", vss);
len = strlen(v);
data += 2;
size -= 2;
}
}
break;
case EXIF_FORMAT_LONG: {
size_t i, len = 0;
for(i=0; i<entry->components; i++) {
if (size < 4)
break;
if (len > maxlen)
break;
vl = exif_get_long (data, entry->order);
snprintf (v+len, maxlen-len, "%lu ", (long unsigned) vl);
len = strlen(v);
data += 4;
size -= 4;
}
}
break;
case EXIF_FORMAT_SLONG: {
size_t i, len = 0;
for(i=0; i<entry->components; i++) {
if (size < 4)
break;
if (len > maxlen)
break;
vsl = exif_get_slong (data, entry->order);
snprintf (v+len, maxlen-len, "%li ", (long int) vsl);
len = strlen(v);
data += 4;
size -= 4;
}
}
break;
case EXIF_FORMAT_RATIONAL:
if (size < exif_format_get_size (EXIF_FORMAT_RATIONAL)) return NULL;
if (entry->components < 1) return NULL; /* FIXME: could handle more than 1 too */
vr = exif_get_rational (data, entry->order);
if (!vr.denominator) break;
snprintf (v, maxlen, "%2.4f", (double) vr.numerator /
vr.denominator);
break;
case EXIF_FORMAT_SRATIONAL:
if (size < exif_format_get_size (EXIF_FORMAT_SRATIONAL)) return NULL;
if (entry->components < 1) return NULL; /* FIXME: could handle more than 1 too */
vsr = exif_get_srational (data, entry->order);
if (!vsr.denominator) break;
snprintf (v, maxlen, "%2.4f", (double) vsr.numerator /
vsr.denominator);
break;
case EXIF_FORMAT_UNDEFINED:
default:
snprintf (v, maxlen, _("%i bytes unknown data"), entry->size);
break;
}
break;
}
return v;
}
+41
View File
@@ -0,0 +1,41 @@
/* mnote-apple-entry.h
*
* Copyright (c) 2018 zhanwang-sky <zhanwang_sky@163.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*/
#ifndef LIBEXIF_MNOTE_APPLE_ENTRY_H
#define LIBEXIF_MNOTE_APPLE_ENTRY_H
#include <libexif/exif-byte-order.h>
#include <libexif/exif-format.h>
#include <libexif/apple/mnote-apple-tag.h>
typedef struct _MnoteAppleEntry MnoteAppleEntry;
struct _MnoteAppleEntry {
MnoteAppleTag tag;
ExifFormat format;
unsigned long components;
unsigned char *data;
unsigned int size;
ExifByteOrder order;
};
char *mnote_apple_entry_get_value(MnoteAppleEntry *, char *, unsigned int);
#endif /* !defined(LIBEXIF_MNOTE_APPLE_ENTRY_H) */
+89
View File
@@ -0,0 +1,89 @@
/* mnote-apple-tag.c:
*
* Copyright (c) 2018 zhanwang-sky <zhanwang_sky@163.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*/
#include <config.h>
#include "mnote-apple-tag.h"
#include <libexif/i18n.h>
#include <libexif/exif-utils.h>
#include <stdlib.h>
static const struct {
MnoteAppleTag tag;
const char *name;
const char *title;
const char *description;
} table[] = {
#ifndef NO_VERBOSE_TAG_STRINGS
{MNOTE_APPLE_TAG_HDR, "HDR", N_("HDR Mode"), ""},
{MNOTE_APPLE_TAG_RUNTIME, "RUNTIME", N_("Runtime"), ""},
{MNOTE_APPLE_TAG_ACCELERATION_VECTOR, "ACCELERATION_VECTOR", N_("Acceleration Vector"), ""},
{MNOTE_APPLE_TAG_HDR, "HDR", N_("HDR"), ""},
{MNOTE_APPLE_TAG_BURST_UUID, "BURST_UUID", N_("Burst UUID"), ""},
{MNOTE_APPLE_TAG_MEDIA_GROUP_UUID, "MEDIA_GROUP_UUID", N_("Media Group UUID"), ""},
{MNOTE_APPLE_TAG_IMAGE_UNIQUE_ID, "IMAGE_UNIQUE_ID", N_("Image Unique ID"), ""},
#endif
{0, NULL, NULL, NULL}
};
const char *
mnote_apple_tag_get_name(MnoteAppleTag t) {
unsigned int i;
for (i = 0; i < sizeof (table) / sizeof (table[0]); i++) {
if (table[i].tag == t) {
return table[i].name;
}
}
return NULL;
}
const char *
mnote_apple_tag_get_title(MnoteAppleTag t) {
unsigned int i;
(void) bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
for (i = 0; i < sizeof (table) / sizeof (table[0]); i++) {
if (table[i].tag == t) {
return _(table[i].title);
}
}
return NULL;
}
const char *
mnote_apple_tag_get_description(MnoteAppleTag t) {
unsigned int i;
for (i = 0; i < sizeof (table) / sizeof (table[0]); i++) {
if (table[i].tag == t) {
if (!table[i].description || !*table[i].description) {
return "";
}
(void) bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
return _(table[i].description);
}
}
return NULL;
}
+46
View File
@@ -0,0 +1,46 @@
/* mnote-apple-tag.h
*
* Copyright (c) 2018 zhanwang-sky <zhanwang_sky@163.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*/
#ifndef LIBEXIF_MNOTE_APPLE_TAG_H
#define LIBEXIF_MNOTE_APPLE_TAG_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
enum _MnoteAppleTag {
MNOTE_APPLE_TAG_RUNTIME = 0x3,
MNOTE_APPLE_TAG_ACCELERATION_VECTOR = 0x9,
MNOTE_APPLE_TAG_HDR = 0xA,
MNOTE_APPLE_TAG_BURST_UUID = 0xB,
MNOTE_APPLE_TAG_MEDIA_GROUP_UUID = 0x11,
MNOTE_APPLE_TAG_IMAGE_UNIQUE_ID = 0x15
};
typedef enum _MnoteAppleTag MnoteAppleTag;
const char *mnote_apple_tag_get_name(MnoteAppleTag);
const char *mnote_apple_tag_get_title(MnoteAppleTag);
const char *mnote_apple_tag_get_description(MnoteAppleTag);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* !defined(LIBEXIF_MNOTE_APPLE_TAG_H) */
+9 -1
View File
@@ -228,6 +228,13 @@ exif_mnote_data_canon_load (ExifMnoteData *ne,
/* Read the number of tags */
c = exif_get_short (buf + datao, n->order);
datao += 2;
/* Just use an arbitrary max tag limit here to avoid needing to much memory or time. There are 24 named tags currently.
* current 2020 camera EOS M6 Mark 2 had 156 entries.
* The format allows specifying the same range of memory as often as it can, so this multiplies quickly. */
if (c > 250) {
exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifMnoteCanon", "Too much tags (%d) in Canon MakerNote", c);
return;
}
/* Remove any old entries */
exif_mnote_data_canon_clear (n);
@@ -391,10 +398,11 @@ exif_mnote_data_canon_identify (const ExifData *ed, const ExifEntry *e)
{
char value[8];
(void) e; /* unused */
ExifEntry *em = exif_data_get_entry (ed, EXIF_TAG_MAKE);
if (!em)
return 0;
(void) e; /* unused */
return !strcmp (exif_entry_get_value (em, value, sizeof (value)), "Canon");
}
+3 -3
View File
@@ -20,8 +20,8 @@
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
#ifndef __EXIF_MNOTE_DATA_CANON_H__
#define __EXIF_MNOTE_DATA_CANON_H__
#ifndef LIBEXIF_EXIF_MNOTE_DATA_CANON_H
#define LIBEXIF_EXIF_MNOTE_DATA_CANON_H
#include <libexif/exif-byte-order.h>
#include <libexif/exif-mnote-data.h>
@@ -57,4 +57,4 @@ int exif_mnote_data_canon_identify (const ExifData *ed, const ExifEntry *e);
ExifMnoteData *exif_mnote_data_canon_new (ExifMem *mem, ExifDataOption o);
#endif /* __EXIF_MNOTE_DATA_CANON_H__ */
#endif /* !defined(LIBEXIF_EXIF_MNOTE_DATA_CANON_H) */
+1
View File
@@ -703,6 +703,7 @@ mnote_canon_entry_get_value (const MnoteCanonEntry *entry, unsigned int t, char
case MNOTE_CANON_TAG_OWNER:
CC (entry->components, 32, val, maxlen)
/* Fall through; ImageType can have many sizes */
/* fall through */
case MNOTE_CANON_TAG_IMAGE_TYPE:
CF (entry->format, EXIF_FORMAT_ASCII, val, maxlen)
strncpy (val, (char *)data, MIN (entry->size, maxlen));
+3 -3
View File
@@ -20,8 +20,8 @@
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
#ifndef __MNOTE_CANON_ENTRY_H__
#define __MNOTE_CANON_ENTRY_H__
#ifndef LIBEXIF_MNOTE_CANON_ENTRY_H
#define LIBEXIF_MNOTE_CANON_ENTRY_H
#include <libexif/exif-format.h>
#include <libexif/exif-byte-order.h>
@@ -43,4 +43,4 @@ struct _MnoteCanonEntry {
unsigned int mnote_canon_entry_count_values (const MnoteCanonEntry *);
char *mnote_canon_entry_get_value (const MnoteCanonEntry *, unsigned int t, char *val, unsigned int maxlen);
#endif /* __MNOTE_CANON_ENTRY_H__ */
#endif /* !defined(LIBEXIF_MNOTE_CANON_ENTRY_H) */
+79
View File
@@ -44,7 +44,71 @@ static const struct {
{MNOTE_CANON_TAG_OWNER, "OwnerName", N_("Owner Name"), ""},
{MNOTE_CANON_TAG_COLOR_INFORMATION, "ColorInformation", N_("Color Information"), ""},
{MNOTE_CANON_TAG_SERIAL_NUMBER, "SerialNumber", N_("Serial Number"), ""},
{MNOTE_CANON_TAG_CAMERA_INFO, "CameraInfo", N_("Camera Info"), ""},
{MNOTE_CANON_TAG_FILE_LENGTH, "FileLength", N_("File Length"), ""},
{MNOTE_CANON_TAG_CUSTOM_FUNCS, "CustomFunctions", N_("Custom Functions"), ""},
{MNOTE_CANON_TAG_MODEL_ID,"ModelID", N_("Model ID"), ""},
{MNOTE_CANON_TAG_MOVIE_INFO,"MovieInfo", N_("Movie Info"), ""},
{MNOTE_CANON_TAG_AF_INFO,"AFInfo", N_("AF Info"), ""},
{MNOTE_CANON_TAG_THUMBNAIL_VALID_AREA,"ThumbnailValidArea", N_("Thumbnail Valid Area"), ""},
{MNOTE_CANON_TAG_SERIAL_NUMBER_FORMAT,"SerialNumberFormat", N_("Serial Number Format"), ""},
{MNOTE_CANON_TAG_SUPER_MACRO,"SuperMacro", N_("Super Macro"), ""},
{MNOTE_CANON_TAG_DATE_STAMP_MODE,"DateStampMode", N_("Date Stamp Mode"), ""},
{MNOTE_CANON_TAG_MY_COLORS,"MyColors", N_("My Colors"), ""},
{MNOTE_CANON_TAG_FIRMWARE_REVISION,"FirmwareRevision", N_("Firmware Revision"), ""},
{MNOTE_CANON_TAG_CATEGORIES,"Categories", N_("Categories"), ""},
{MNOTE_CANON_TAG_FACEDETECT1,"FaceDetect1", N_("Face Detect 1"), ""},
{MNOTE_CANON_TAG_FACEDETECT2,"FaceDetect2", N_("Face Detect 2"), ""},
{MNOTE_CANON_TAG_AF_INFO2,"AFInfo2", N_("AF Info 2"), ""},
{MNOTE_CANON_TAG_CONTRAST_INFO,"ContrastInfo", N_("Contrast Info"), ""},
{MNOTE_CANON_TAG_IMAGE_UNIQUE_ID,"ImageUniqueID", N_("Image Unique ID"), ""},
{MNOTE_CANON_TAG_WB_INFO,"WBInfo", N_("WB Info"), ""},
{MNOTE_CANON_TAG_FACEDETECT3,"FaceDetect3", N_("Face Detect 3"), ""},
{MNOTE_CANON_TAG_TIMEINFO,"TimeInfo", N_("Time Info"), ""},
{MNOTE_CANON_TAG_BATTERY_TYPE,"Battery Type", N_("Battery Type"), ""},
{MNOTE_CANON_TAG_AF_INFO3,"AFInfo3", N_("AF Info 3"), ""},
{MNOTE_CANON_TAG_RAW_DATA_OFFSET,"RawDataOffset", N_("Raw Data Offset"), ""},
{MNOTE_CANON_TAG_ORIGINAL_DECISION_DATA_OFFSET,"OriginalDecisionDataOffset", N_("Original Decision Data Offset"), ""},
{MNOTE_CANON_TAG_PERSONAL_FUNCTIONS,"PesonalFunctions", N_("Personal Functions"), ""},
{MNOTE_CANON_TAG_PERSONAL_FUNCTIONS_VALUES,"PersonalFunctionsValues", N_("Personal Functions Values"), ""},
{MNOTE_CANON_TAG_FILE_INFO,"FileInfo", N_("File Info"), ""},
{MNOTE_CANON_TAG_LENS_MODEL,"LensModel", N_("Lens Model"), ""},
{MNOTE_CANON_TAG_CMOS_SERIAL,"CMOSSerialNumber", N_("CMOS Serial Number"), ""},
{MNOTE_CANON_TAG_DUST_REMOVAL_DATA,"DustRemovalData", N_("Dust Removal Data"), ""},
{MNOTE_CANON_TAG_CROP_INFO,"CropInfo", N_("Crop Info"), ""},
{MNOTE_CANON_TAG_CUSTOM_FUNCTIONS2,"CustomFunctions2", N_("Custom Functions 2"), ""},
{MNOTE_CANON_TAG_ASPECT_INFO,"AspectInfo", N_("Aspect Info"), ""},
{MNOTE_CANON_TAG_TONE_CURVE_TABLE,"ToneCurveTable", N_("Tone Curve Table"), ""},
{MNOTE_CANON_TAG_SHARPNESS_TABLE,"SharpnessTable", N_("Sharpness Table"), ""},
{MNOTE_CANON_TAG_SHARPNESS_FREQ_TABLE,"SharpnessFreqTable", N_("Sharpness Frequency Table"), ""},
{MNOTE_CANON_TAG_WHITEBALANCE_TABLE,"WhitebalanceTable", N_("Whitebalance Table"), ""},
{MNOTE_CANON_TAG_COLOR_BALANCE,"ColorBalance", N_("Color Balance"), ""},
{MNOTE_CANON_TAG_MEASURED_COLOR,"MeasuredColor", N_("Measured Color"), ""},
{MNOTE_CANON_TAG_COLOR_TEMPERATURE,"ColorTemperature", N_("Color Temperature"), ""},
{MNOTE_CANON_TAG_CANON_FLAGS,"CanonFlags", N_("Canon Flags"), ""},
{MNOTE_CANON_TAG_MODIFIED_INFO,"ModifiedInfo", N_("Modified Info"), ""},
{MNOTE_CANON_TAG_TONECURVE_MATCHING,"TonecurveMatching", N_("Tonecurve Matching"), ""},
{MNOTE_CANON_TAG_WHITEBALANCE_MATCHING,"WhitebalanceMatching", N_("Whitebalance Matching"), ""},
{MNOTE_CANON_TAG_COLOR_SPACE,"ColorSpace", N_("Color Space"), ""},
{MNOTE_CANON_TAG_PREVIEW_IMAGE_INFO,"PreviewImageInfo", N_("Preview Image Info"), ""},
{MNOTE_CANON_TAG_VRD_OFFSET,"VRDOffset", N_("VRD Offset"), ""},
{MNOTE_CANON_TAG_SENSOR_INFO,"SensorInfo", N_("Sensor Info"), ""},
{MNOTE_CANON_TAG_WB_PACKET,"WBPacket", N_("WB Packet"), ""},
{MNOTE_CANON_TAG_FLAVOR,"Flavor", N_("Flavor"), ""},
{MNOTE_CANON_TAG_PICTURESTYLE_USERDEF,"PictureStyleUserDef", N_("Picture Style Userdefined"), ""},
{MNOTE_CANON_TAG_PICTURESTYLE_PC,"PictureStylePC", N_("Picture Style PC"), ""},
{MNOTE_CANON_TAG_CUSTOMPICTURE_STYLE_FN,"CustomPictureStyleFN", N_("Custom Picture Style Filename"), ""},
{MNOTE_CANON_TAG_AF_MICRO_ADJUST,"AFMicroAdjust", N_("AF Micro Adjust"), ""},
{MNOTE_CANON_TAG_VIGNETTING_CORRECT,"VignettingCorrect", N_("Vignetting Correct"), ""},
{MNOTE_CANON_TAG_VIGNETTING_CORRECT2,"VignettingCorrect2", N_("Vignetting Correct 2"), ""},
{MNOTE_CANON_TAG_LIGHTINGOPT,"LightingOpt", N_("LightingOpt"), ""},
{MNOTE_CANON_TAG_LENS_INFO,"LensInfo", N_("Lens Info"), ""},
{MNOTE_CANON_TAG_AMBIENCE_INFO,"AmbienceInfo", N_("Ambience_Info"), ""},
{MNOTE_CANON_TAG_MULTI_EXPOSURE,"MultiExposure", N_("Multi Exposure"), ""},
{MNOTE_CANON_TAG_FILTER_INFO,"FilterInfo", N_("Filter Info"), ""},
{MNOTE_CANON_TAG_HDR_INFO,"HDRInfo", N_("HDR Info"), ""},
{MNOTE_CANON_TAG_AF_CONFIG,"AFConfig", N_("AF Config"), ""},
{MNOTE_CANON_TAG_RAW_BURST_INFO,"RawBurstInfo", N_("Raw Burst Info"), ""},
#endif
{0, NULL, NULL, NULL}
};
@@ -87,9 +151,11 @@ static const struct {
{MNOTE_CANON_TAG_SETTINGS_1, 34, N_("Display Aperture")},
{MNOTE_CANON_TAG_SETTINGS_1, 35, N_("Zoom Source Width")},
{MNOTE_CANON_TAG_SETTINGS_1, 36, N_("Zoom Target Width")},
{MNOTE_CANON_TAG_SETTINGS_1, 38, N_("Spot Metering Mode")},
{MNOTE_CANON_TAG_SETTINGS_1, 39, N_("Photo Effect")},
{MNOTE_CANON_TAG_SETTINGS_1, 40, N_("Manual Flash Output")},
{MNOTE_CANON_TAG_SETTINGS_1, 41, N_("Color Tone")},
{MNOTE_CANON_TAG_SETTINGS_1, 45, N_("SRAW Quality")},
{MNOTE_CANON_TAG_FOCAL_LENGTH, 0, N_("Focal Type")},
{MNOTE_CANON_TAG_FOCAL_LENGTH, 1, N_("Focal Length")},
{MNOTE_CANON_TAG_FOCAL_LENGTH, 2, N_("Focal Plane X Size")},
@@ -103,15 +169,19 @@ static const struct {
{MNOTE_CANON_TAG_SETTINGS_2, 6, N_("White Balance")},
{MNOTE_CANON_TAG_SETTINGS_2, 7, N_("Slow Shutter")},
{MNOTE_CANON_TAG_SETTINGS_2, 8, N_("Sequence Number")},
{MNOTE_CANON_TAG_SETTINGS_2, 9, N_("Optical Zoom Code")},
{MNOTE_CANON_TAG_SETTINGS_2, 11, N_("Camera Temperature")},
{MNOTE_CANON_TAG_SETTINGS_2, 12, N_("Flash Guide Number")},
{MNOTE_CANON_TAG_SETTINGS_2, 13, N_("AF Point")},
{MNOTE_CANON_TAG_SETTINGS_2, 14, N_("Flash Exposure Compensation")},
{MNOTE_CANON_TAG_SETTINGS_2, 15, N_("AE Bracketing")},
{MNOTE_CANON_TAG_SETTINGS_2, 16, N_("AE Bracket Value")},
{MNOTE_CANON_TAG_SETTINGS_2, 17, N_("Control Mode")},
{MNOTE_CANON_TAG_SETTINGS_2, 18, N_("Focus Distance Upper")},
{MNOTE_CANON_TAG_SETTINGS_2, 19, N_("Focus Distance Lower")},
{MNOTE_CANON_TAG_SETTINGS_2, 20, N_("F-Number")},
{MNOTE_CANON_TAG_SETTINGS_2, 21, N_("Exposure Time")},
{MNOTE_CANON_TAG_SETTINGS_2, 22, N_("Measured EV 2")},
{MNOTE_CANON_TAG_SETTINGS_2, 23, N_("Bulb Duration")},
{MNOTE_CANON_TAG_SETTINGS_2, 25, N_("Camera Type")},
{MNOTE_CANON_TAG_SETTINGS_2, 26, N_("Auto Rotate")},
@@ -121,9 +191,18 @@ static const struct {
{MNOTE_CANON_TAG_PANORAMA, 2, N_("Panorama Frame")},
{MNOTE_CANON_TAG_PANORAMA, 5, N_("Panorama Direction")},
{MNOTE_CANON_TAG_COLOR_INFORMATION, 0, N_("Tone Curve")},
{MNOTE_CANON_TAG_COLOR_INFORMATION, 1, N_("Sharpness")},
{MNOTE_CANON_TAG_COLOR_INFORMATION, 2, N_("Sharpness Frequency")},
{MNOTE_CANON_TAG_COLOR_INFORMATION, 3, N_("Sensor Red Level")},
{MNOTE_CANON_TAG_COLOR_INFORMATION, 4, N_("Sensor Blue Level")},
{MNOTE_CANON_TAG_COLOR_INFORMATION, 5, N_("White Balance Red")},
{MNOTE_CANON_TAG_COLOR_INFORMATION, 6, N_("White Balance Blue")},
{MNOTE_CANON_TAG_COLOR_INFORMATION, 7, N_("White Balance")},
{MNOTE_CANON_TAG_COLOR_INFORMATION, 8, N_("Color Temperature")},
{MNOTE_CANON_TAG_COLOR_INFORMATION, 9, N_("Picture Style")},
{MNOTE_CANON_TAG_COLOR_INFORMATION, 10, N_("Digital Gain")},
{MNOTE_CANON_TAG_COLOR_INFORMATION, 11, N_("White Balance Shift AB")},
{MNOTE_CANON_TAG_COLOR_INFORMATION, 12, N_("White Balance Shift GM")},
#endif
{0, 0, NULL}
};
+71 -7
View File
@@ -20,8 +20,8 @@
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
#ifndef __MNOTE_CANON_TAG_H__
#define __MNOTE_CANON_TAG_H__
#ifndef LIBEXIF_MNOTE_CANON_TAG_H
#define LIBEXIF_MNOTE_CANON_TAG_H
#include <libexif/exif-data.h>
@@ -31,10 +31,10 @@ extern "C" {
enum _MnoteCanonTag {
MNOTE_CANON_TAG_UNKNOWN_0 = 0x0,
MNOTE_CANON_TAG_SETTINGS_1 = 0x1,
MNOTE_CANON_TAG_SETTINGS_1 = 0x1, /* subtree */
MNOTE_CANON_TAG_FOCAL_LENGTH = 0x2,
MNOTE_CANON_TAG_UNKNOWN_3 = 0x3,
MNOTE_CANON_TAG_SETTINGS_2 = 0x4,
MNOTE_CANON_TAG_SETTINGS_2 = 0x4, /* subtree */
MNOTE_CANON_TAG_PANORAMA = 0x5,
MNOTE_CANON_TAG_IMAGE_TYPE = 0x6,
MNOTE_CANON_TAG_FIRMWARE = 0x7,
@@ -42,9 +42,73 @@ enum _MnoteCanonTag {
MNOTE_CANON_TAG_OWNER = 0x9,
MNOTE_CANON_TAG_UNKNOWN_10 = 0xa,
MNOTE_CANON_TAG_SERIAL_NUMBER = 0xc,
MNOTE_CANON_TAG_UNKNOWN_13 = 0xd,
MNOTE_CANON_TAG_CAMERA_INFO = 0xd,
MNOTE_CANON_TAG_FILE_LENGTH = 0xe,
MNOTE_CANON_TAG_CUSTOM_FUNCS = 0xf,
MNOTE_CANON_TAG_COLOR_INFORMATION = 0xa0
MNOTE_CANON_TAG_MODEL_ID = 0x10,
MNOTE_CANON_TAG_MOVIE_INFO = 0x11, /* subtree */
MNOTE_CANON_TAG_AF_INFO = 0x12, /* subtree */
MNOTE_CANON_TAG_THUMBNAIL_VALID_AREA = 0x13,
MNOTE_CANON_TAG_SERIAL_NUMBER_FORMAT = 0x15,
MNOTE_CANON_TAG_SUPER_MACRO = 0x1a,
MNOTE_CANON_TAG_DATE_STAMP_MODE = 0x1c,
MNOTE_CANON_TAG_MY_COLORS = 0x1d, /* subtree */
MNOTE_CANON_TAG_FIRMWARE_REVISION = 0x1e,
MNOTE_CANON_TAG_CATEGORIES = 0x23,
MNOTE_CANON_TAG_FACEDETECT1 = 0x24, /* subtree */
MNOTE_CANON_TAG_FACEDETECT2 = 0x25, /* subtree */
MNOTE_CANON_TAG_AF_INFO2 = 0x26, /* subtree */
MNOTE_CANON_TAG_CONTRAST_INFO = 0x27, /* subtree */
MNOTE_CANON_TAG_IMAGE_UNIQUE_ID = 0x28,
MNOTE_CANON_TAG_WB_INFO = 0x29, /* subtree */
MNOTE_CANON_TAG_FACEDETECT3 = 0x2f, /* subtree */
MNOTE_CANON_TAG_TIMEINFO = 0x35, /* subtree */
MNOTE_CANON_TAG_BATTERY_TYPE = 0x38,
MNOTE_CANON_TAG_AF_INFO3 = 0x3c, /* subtree */
MNOTE_CANON_TAG_RAW_DATA_OFFSET = 0x81,
MNOTE_CANON_TAG_ORIGINAL_DECISION_DATA_OFFSET = 0x83,
MNOTE_CANON_TAG_PERSONAL_FUNCTIONS = 0x91, /* subtree */
MNOTE_CANON_TAG_PERSONAL_FUNCTIONS_VALUES = 0x92, /* subtree */
MNOTE_CANON_TAG_FILE_INFO = 0x93, /* subtree */
MNOTE_CANON_TAG_LENS_MODEL = 0x95,
MNOTE_CANON_TAG_CMOS_SERIAL = 0x96,
MNOTE_CANON_TAG_DUST_REMOVAL_DATA = 0x97,
MNOTE_CANON_TAG_CROP_INFO = 0x98, /* subtree */
MNOTE_CANON_TAG_CUSTOM_FUNCTIONS2 = 0x99, /* subtree */
MNOTE_CANON_TAG_ASPECT_INFO = 0x9a, /* subtree */
MNOTE_CANON_TAG_COLOR_INFORMATION = 0xa0, /* subtree */
MNOTE_CANON_TAG_TONE_CURVE_TABLE = 0xa1,
MNOTE_CANON_TAG_SHARPNESS_TABLE = 0xa2,
MNOTE_CANON_TAG_SHARPNESS_FREQ_TABLE = 0xa3,
MNOTE_CANON_TAG_WHITEBALANCE_TABLE = 0xa3,
MNOTE_CANON_TAG_COLOR_BALANCE = 0xa9, /* subtree */
MNOTE_CANON_TAG_MEASURED_COLOR = 0xaa, /* subtree */
MNOTE_CANON_TAG_COLOR_TEMPERATURE = 0xae,
MNOTE_CANON_TAG_CANON_FLAGS = 0xb0, /* subtree */
MNOTE_CANON_TAG_MODIFIED_INFO = 0xb1, /* subtree */
MNOTE_CANON_TAG_TONECURVE_MATCHING = 0xb2,
MNOTE_CANON_TAG_WHITEBALANCE_MATCHING = 0xb3,
MNOTE_CANON_TAG_COLOR_SPACE = 0xb4,
MNOTE_CANON_TAG_PREVIEW_IMAGE_INFO = 0xb6, /* subtree */
MNOTE_CANON_TAG_VRD_OFFSET = 0xd0,
MNOTE_CANON_TAG_SENSOR_INFO = 0xe0, /* subtree */
MNOTE_CANON_TAG_WB_PACKET = 0x4001, /* subtree */
MNOTE_CANON_TAG_COLOR_INFO = 0x4003, /* subtree */
MNOTE_CANON_TAG_FLAVOR = 0x4005,
MNOTE_CANON_TAG_PICTURESTYLE_USERDEF = 0x4008,
MNOTE_CANON_TAG_PICTURESTYLE_PC = 0x4009,
MNOTE_CANON_TAG_CUSTOMPICTURE_STYLE_FN = 0x4010,
MNOTE_CANON_TAG_AF_MICRO_ADJUST = 0x4013, /* subtree */
MNOTE_CANON_TAG_VIGNETTING_CORRECT = 0x4015, /* subtree */
MNOTE_CANON_TAG_VIGNETTING_CORRECT2 = 0x4016, /* subtree */
MNOTE_CANON_TAG_LIGHTINGOPT = 0x4018, /* subtree */
MNOTE_CANON_TAG_LENS_INFO = 0x4019, /* subtree */
MNOTE_CANON_TAG_AMBIENCE_INFO = 0x4020, /* subtree */
MNOTE_CANON_TAG_MULTI_EXPOSURE = 0x4021, /* subtree */
MNOTE_CANON_TAG_FILTER_INFO = 0x4024, /* subtree */
MNOTE_CANON_TAG_HDR_INFO = 0x4025, /* subtree */
MNOTE_CANON_TAG_AF_CONFIG = 0x4028, /* subtree */
MNOTE_CANON_TAG_RAW_BURST_INFO = 0x403f /* subtree */
};
typedef enum _MnoteCanonTag MnoteCanonTag;
@@ -58,4 +122,4 @@ const char *mnote_canon_tag_get_description (MnoteCanonTag);
}
#endif /* __cplusplus */
#endif /* __MNOTE_CANON_TAG_H__ */
#endif /* !defined(LIBEXIF_MNOTE_CANON_TAG_H) */
+3 -3
View File
@@ -22,8 +22,8 @@
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
#ifndef __EXIF_BYTE_ORDER_H__
#define __EXIF_BYTE_ORDER_H__
#ifndef LIBEXIF_EXIF_BYTE_ORDER_H
#define LIBEXIF_EXIF_BYTE_ORDER_H
#ifdef __cplusplus
extern "C" {
@@ -47,4 +47,4 @@ const char *exif_byte_order_get_name (ExifByteOrder order);
}
#endif /* __cplusplus */
#endif /* __EXIF_BYTE_ORDER_H__ */
#endif /* !defined(LIBEXIF_EXIF_BYTE_ORDER_H) */
+3 -3
View File
@@ -22,8 +22,8 @@
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
#ifndef __EXIF_CONTENT_H__
#define __EXIF_CONTENT_H__
#ifndef LIBEXIF_EXIF_CONTENT_H
#define LIBEXIF_EXIF_CONTENT_H
#ifdef __cplusplus
extern "C" {
@@ -180,4 +180,4 @@ void exif_content_log (ExifContent *content, ExifLog *log);
}
#endif /* __cplusplus */
#endif /* __EXIF_CONTENT_H__ */
#endif /* !defined(LIBEXIF_EXIF_CONTENT_H) */
+3 -3
View File
@@ -20,8 +20,8 @@
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
#ifndef __EXIF_DATA_TYPE_H__
#define __EXIF_DATA_TYPE_H__
#ifndef LIBEXIF_EXIF_DATA_TYPE_H
#define LIBEXIF_EXIF_DATA_TYPE_H
#ifdef __cplusplus
extern "C" {
@@ -45,4 +45,4 @@ typedef enum {
}
#endif /* __cplusplus */
#endif /* __EXIF_TAG_H__ */
#endif /* !defined(LIBEXIF_EXIF_DATA_TYPE_H) */
+3 -3
View File
@@ -22,8 +22,8 @@
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
#ifndef __EXIF_DATA_H__
#define __EXIF_DATA_H__
#ifndef LIBEXIF_EXIF_DATA_H
#define LIBEXIF_EXIF_DATA_H
#ifdef __cplusplus
extern "C" {
@@ -265,4 +265,4 @@ void exif_data_log (ExifData *data, ExifLog *log);
}
#endif /* __cplusplus */
#endif /* __EXIF_DATA_H__ */
#endif /* !defined(LIBEXIF_EXIF_DATA_H) */
+3 -3
View File
@@ -22,8 +22,8 @@
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
#ifndef __EXIF_ENTRY_H__
#define __EXIF_ENTRY_H__
#ifndef LIBEXIF_EXIF_ENTRY_H
#define LIBEXIF_EXIF_ENTRY_H
#ifdef __cplusplus
extern "C" {
@@ -185,4 +185,4 @@ void exif_entry_dump (ExifEntry *entry, unsigned int indent);
}
#endif /* __cplusplus */
#endif /* __EXIF_ENTRY_H__ */
#endif /* !defined(LIBEXIF_EXIF_ENTRY_H) */
+3 -3
View File
@@ -23,8 +23,8 @@
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
#ifndef __EXIF_FORMAT_H__
#define __EXIF_FORMAT_H__
#ifndef LIBEXIF_EXIF_FORMAT_H
#define LIBEXIF_EXIF_FORMAT_H
#ifdef __cplusplus
extern "C" {
@@ -64,4 +64,4 @@ unsigned char exif_format_get_size (ExifFormat format);
}
#endif /* __cplusplus */
#endif /* __EXIF_FORMAT_H__ */
#endif /* !defined(LIBEXIF_EXIF_FORMAT_H) */
+3 -3
View File
@@ -20,8 +20,8 @@
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#ifndef __EXIF_IFD_H__
#define __EXIF_IFD_H__
#ifndef LIBEXIF_EXIF_IFD_H
#define LIBEXIF_EXIF_IFD_H
#ifdef __cplusplus
extern "C" {
@@ -50,4 +50,4 @@ const char *exif_ifd_get_name (ExifIfd ifd);
}
#endif /* __cplusplus */
#endif /* __EXIF_IFD_H__ */
#endif /* !defined(LIBEXIF_EXIF_IFD_H) */
+1 -1
View File
@@ -169,7 +169,7 @@ exif_loader_write (ExifLoader *eld, unsigned char *buf, unsigned int len)
unsigned int i;
begin:
if (!eld || (len && !buf))
if (!eld || (len && !buf))
return 0;
switch (eld->state) {
+3 -3
View File
@@ -22,8 +22,8 @@
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
#ifndef __EXIF_LOADER_H__
#define __EXIF_LOADER_H__
#ifndef LIBEXIF_EXIF_LOADER_H
#define LIBEXIF_EXIF_LOADER_H
#include <libexif/exif-data.h>
#include <libexif/exif-log.h>
@@ -127,4 +127,4 @@ void exif_loader_log (ExifLoader *loader, ExifLog *log);
}
#endif /* __cplusplus */
#endif /* __EXIF_LOADER_H__ */
#endif /* !defined(LIBEXIF_EXIF_LOADER_H) */
+3 -3
View File
@@ -22,8 +22,8 @@
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
#ifndef __EXIF_LOG_H__
#define __EXIF_LOG_H__
#ifndef LIBEXIF_EXIF_LOG_H
#define LIBEXIF_EXIF_LOG_H
#ifdef __cplusplus
extern "C" {
@@ -115,4 +115,4 @@ void exif_logv (ExifLog *log, ExifLogCode, const char *domain,
}
#endif /* __cplusplus */
#endif /* __EXIF_LOG_H__ */
#endif /* !defined(LIBEXIF_EXIF_LOG_H) */
+3 -3
View File
@@ -24,8 +24,8 @@
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
#ifndef __EXIF_MEM_H__
#define __EXIF_MEM_H__
#ifndef LIBEXIF_EXIF_MEM_H
#define LIBEXIF_EXIF_MEM_H
#include <libexif/exif-utils.h>
@@ -90,4 +90,4 @@ ExifMem *exif_mem_new_default (void);
}
#endif /* __cplusplus */
#endif /* __EXIF_MEM_H__ */
#endif /* !defined(LIBEXIF_EXIF_MEM_H) */
+3 -3
View File
@@ -20,8 +20,8 @@
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
#ifndef __EXIF_MNOTE_DATA_PRIV_H__
#define __EXIF_MNOTE_DATA_PRIV_H__
#ifndef LIBEXIF_EXIF_MNOTE_DATA_PRIV_H
#define LIBEXIF_EXIF_MNOTE_DATA_PRIV_H
#ifdef __cplusplus
extern "C" {
@@ -85,4 +85,4 @@ void exif_mnote_data_set_offset (ExifMnoteData *, unsigned int);
}
#endif /* __cplusplus */
#endif /* __EXIF_MNOTE_PRIV_H__ */
#endif /* !defined(LIBEXIF_EXIF_MNOTE_DATA_PRIV_H) */
+3 -3
View File
@@ -22,8 +22,8 @@
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
#ifndef __EXIF_MNOTE_DATA_H__
#define __EXIF_MNOTE_DATA_H__
#ifndef LIBEXIF_EXIF_MNOTE_DATA_H
#define LIBEXIF_EXIF_MNOTE_DATA_H
#ifdef __cplusplus
extern "C" {
@@ -121,4 +121,4 @@ void exif_mnote_data_log (ExifMnoteData *, ExifLog *);
}
#endif /* __cplusplus */
#endif /* __EXIF_MNOTE_DATA_H__ */
#endif /* !defined(LIBEXIF_EXIF_MNOTE_DATA_H) */
+3 -3
View File
@@ -22,8 +22,8 @@
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
#ifndef EXIF_SYSTEM_H
#define EXIF_SYSTEM_H
#ifndef LIBEXIF_EXIF_SYSTEM_H
#define LIBEXIF_EXIF_SYSTEM_H
#if defined(__GNUC__) && (__GNUC__ >= 2)
# define UNUSED(param) UNUSED_PARAM_##param __attribute__((unused))
@@ -31,4 +31,4 @@
# define UNUSED(param) param
#endif
#endif /* !defined(EXIF_SYSTEM_H) */
#endif /* !defined(LIBEXIF_EXIF_SYSTEM_H) */
+13 -3
View File
@@ -22,8 +22,8 @@
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
#ifndef __EXIF_TAG_H__
#define __EXIF_TAG_H__
#ifndef LIBEXIF_EXIF_TAG_H
#define LIBEXIF_EXIF_TAG_H
#ifdef __cplusplus
extern "C" {
@@ -107,6 +107,7 @@ typedef enum {
EXIF_TAG_RELATED_IMAGE_FILE_FORMAT = 0x1000,
EXIF_TAG_RELATED_IMAGE_WIDTH = 0x1001,
EXIF_TAG_RELATED_IMAGE_LENGTH = 0x1002,
EXIF_TAG_IMAGE_DEPTH = 0x80e5,
EXIF_TAG_CFA_REPEAT_PATTERN_DIM = 0x828d,
EXIF_TAG_CFA_PATTERN = 0x828e,
EXIF_TAG_BATTERY_LEVEL = 0x828f,
@@ -123,9 +124,18 @@ typedef enum {
EXIF_TAG_ISO_SPEED_RATINGS = 0x8827,
EXIF_TAG_OECF = 0x8828,
EXIF_TAG_TIME_ZONE_OFFSET = 0x882a,
EXIF_TAG_SENSITIVITY_TYPE = 0x8830,
EXIF_TAG_STANDARD_OUTPUT_SENSITIVITY = 0x8831,
EXIF_TAG_RECOMMENDED_EXPOSURE_INDEX = 0x8832,
EXIF_TAG_ISO_SPEED = 0x8833,
EXIF_TAG_ISO_SPEEDLatitudeYYY = 0x8834,
EXIF_TAG_ISO_SPEEDLatitudeZZZ = 0x8835,
EXIF_TAG_EXIF_VERSION = 0x9000,
EXIF_TAG_DATE_TIME_ORIGINAL = 0x9003,
EXIF_TAG_DATE_TIME_DIGITIZED = 0x9004,
EXIF_TAG_OFFSET_TIME = 0x9010,
EXIF_TAG_OFFSET_TIME_ORIGINAL = 0x9011,
EXIF_TAG_OFFSET_TIME_DIGITIZED = 0x9012,
EXIF_TAG_COMPONENTS_CONFIGURATION = 0x9101,
EXIF_TAG_COMPRESSED_BITS_PER_PIXEL = 0x9102,
EXIF_TAG_SHUTTER_SPEED_VALUE = 0x9201,
@@ -297,4 +307,4 @@ unsigned int exif_tag_table_count (void);
}
#endif /* __cplusplus */
#endif /* __EXIF_TAG_H__ */
#endif /* !defined(LIBEXIF_EXIF_TAG_H) */
+2 -2
View File
@@ -91,9 +91,9 @@ exif_get_sshort (const unsigned char *buf, ExifByteOrder order)
if (!buf) return 0;
switch (order) {
case EXIF_BYTE_ORDER_MOTOROLA:
return ((buf[0] << 8) | buf[1]);
return (((unsigned int)buf[0] << 8) | buf[1]);
case EXIF_BYTE_ORDER_INTEL:
return ((buf[1] << 8) | buf[0]);
return (((unsigned int)buf[1] << 8) | buf[0]);
}
/* Won't be reached */
+3 -3
View File
@@ -22,8 +22,8 @@
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
#ifndef __EXIF_UTILS_H__
#define __EXIF_UTILS_H__
#ifndef LIBEXIF_EXIF_UTILS_H
#define LIBEXIF_EXIF_UTILS_H
#ifdef __cplusplus
extern "C" {
@@ -193,4 +193,4 @@ void exif_array_set_byte_order (ExifFormat, unsigned char *, unsigned int,
}
#endif /* __cplusplus */
#endif /* __EXIF_UTILS_H__ */
#endif /* !defined(LIBEXIF_EXIF_UTILS_H) */
+8
View File
@@ -187,6 +187,14 @@ exif_mnote_data_fuji_load (ExifMnoteData *en,
c = exif_get_short (buf + datao, EXIF_BYTE_ORDER_INTEL);
datao += 2;
/* Just use an arbitrary max tag limit here to avoid needing to much memory or time. There are 50 named tags currently.
* Fuji XT2 had 56 entries or so, GFX500 has 68. 150 seems a safe upper bound currently.
* The format allows specifying the same range of memory as often as it can, so this multiplies quickly. */
if (c > 150) {
exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifMnoteDataFuji", "Too much tags (%d) in Fuji MakerNote", c);
return;
}
/* Remove any old entries */
exif_mnote_data_fuji_clear (n);
+3 -3
View File
@@ -20,8 +20,8 @@
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
#ifndef __MNOTE_FUJI_CONTENT_H__
#define __MNOTE_FUJI_CONTENT_H__
#ifndef LIBEXIF_EXIF_MNOTE_DATA_FUJI_H
#define LIBEXIF_EXIF_MNOTE_DATA_FUJI_H
#include <libexif/exif-mnote-data.h>
#include <libexif/exif-mnote-data-priv.h>
@@ -52,4 +52,4 @@ int exif_mnote_data_fuji_identify (const ExifData *ed, const ExifEntry *e);
ExifMnoteData *exif_mnote_data_fuji_new (ExifMem *);
#endif /* __MNOTE_FUJI_CONTENT_H__ */
#endif /* !defined(LIBEXIF_EXIF_MNOTE_DATA_FUJI_H) */
+3 -3
View File
@@ -20,8 +20,8 @@
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
#ifndef __MNOTE_FUJI_ENTRY_H__
#define __MNOTE_FUJI_ENTRY_H__
#ifndef LIBEXIF_MNOTE_FUJI_ENTRY_H
#define LIBEXIF_MNOTE_FUJI_ENTRY_H
#include <libexif/exif-format.h>
#include <libexif/fuji/mnote-fuji-tag.h>
@@ -44,4 +44,4 @@ struct _MnoteFujiEntry {
char *mnote_fuji_entry_get_value (MnoteFujiEntry *entry, char *val, unsigned int maxlen);
#endif /* __MNOTE_FUJI_ENTRY_H__ */
#endif /* !defined(LIBEXIF_MNOTE_FUJI_ENTRY_H) */
+4 -4
View File
@@ -20,8 +20,8 @@
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
#ifndef __MNOTE_FUJI_TAG_H__
#define __MNOTE_FUJI_TAG_H__
#ifndef LIBEXIF_MNOTE_FUJI_TAG_H
#define LIBEXIF_MNOTE_FUJI_TAG_H
#ifdef __cplusplus
extern "C" {
@@ -79,7 +79,7 @@ enum _MnoteFujiTag {
MNOTE_FUJI_TAG_UNKNOWN_4800 = 0x4800,
MNOTE_FUJI_TAG_FILE_SOURCE = 0x8000,
MNOTE_FUJI_TAG_ORDER_NUMBER = 0x8002,
MNOTE_FUJI_TAG_FRAME_NUMBER = 0x8003,
MNOTE_FUJI_TAG_FRAME_NUMBER = 0x8003
};
typedef enum _MnoteFujiTag MnoteFujiTag;
@@ -91,4 +91,4 @@ const char *mnote_fuji_tag_get_description (MnoteFujiTag tag);
}
#endif /* __cplusplus */
#endif /* __MNOTE_FUJI_TAG_H__ */
#endif /* !defined(LIBEXIF_MNOTE_FUJI_TAG_H) */
+3 -3
View File
@@ -20,8 +20,8 @@
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
#ifndef __I18N_H__
#define __I18N_H__
#ifndef LIBEXIF_I18N_H
#define LIBEXIF_I18N_H
#include "config.h"
@@ -51,4 +51,4 @@
# define N_(String) (String)
#endif
#endif /* __I18N_H__ */
#endif /* !defined(LIBEXIF_I18N_H) */
+1 -1
View File
@@ -5,7 +5,7 @@ dnl SPDX-License-Identifier: LGPL-2.0-or-later
AC_DEFUN([CHECK_FAILMALLOC],[dnl
dnl Libtool sets the default library paths
AM_PROG_LIBTOOL
LT_INIT([win32-dll])
path_provided=
failmalloc_requested= dnl Either implicitly or explicitly
AC_ARG_WITH(failmalloc, [ --with-failmalloc=PATH use Failmalloc for tests], [
+1 -1
View File
@@ -28,7 +28,7 @@ else
uname_a=`uname -a 2>&1` # ''
AC_MSG_ERROR([
* POSIX sh \$() command substition does not work with this shell.
* POSIX sh \$() command substitution does not work with this shell.
*
* You are running a very rare species of shell. Please report this
* sighting to <${PACKAGE_BUGREPORT}>:
+1 -1
View File
@@ -83,7 +83,7 @@ AC_REQUIRE([GP_CHECK_DOC_DIR])
# ---------------------------------------------------------------------------
# gtk-doc: We use gtk-doc for building our documentation. However, we
# require the user to explicitely request the build.
# require the user to explicitly request the build.
# ---------------------------------------------------------------------------
try_gtkdoc=false
gtkdoc_msg="no (not requested)"
+1 -1
View File
@@ -604,7 +604,7 @@ typedef unsigned long uintmax_t;
#define __intptr_t_defined
/* we encourage using "long" to store pointer values, never use "int" ! */
#if _STDINT_LONG_MODEL+0 == 242 || _STDINT_LONG_MODEL+0 == 484
typedef unsinged int uintptr_t;
typedef unsigned int uintptr_t;
typedef int intptr_t;
#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL+0 == 444
typedef unsigned long uintptr_t;
-4
View File
@@ -1,4 +0,0 @@
# Specifies autoconf variables for use by the test scripts
SRCDIR=@srcdir@
FAILMALLOC_PATH=@FAILMALLOC_PATH@
+19 -4
View File
@@ -27,17 +27,32 @@ parse_canonicalize () {
-e '/MakerNote (Undefined)$/{N;N;d}'
}
. ${srcdir}/inc-comparetool.sh
# Ensure that names are untranslated
LANG=
LANGUAGE=
LC_ALL=C
export LANG LANGUAGE LC_ALL
for fn in "${srcdir}"/testdata/*.jpg ; do
./test-parse "${fn}" | parse_canonicalize > "${TMPORIGINAL}"
./test-extract -o "${TMPDATA}" "${fn}"
./test-parse "${TMPDATA}" | parse_canonicalize > "${TMPEXTRACTED}"
if ! diff "${TMPORIGINAL}" "${TMPEXTRACTED}"; then
./test-parse$EXEEXT "${fn}" | tr -d '\015' | parse_canonicalize > "${TMPORIGINAL}"
./test-extract$EXEEXT -o "${TMPDATA}" "${fn}"
./test-parse$EXEEXT "${TMPDATA}" | tr -d '\015' | parse_canonicalize > "${TMPEXTRACTED}"
if ${comparetool} "${TMPORIGINAL}" "${TMPEXTRACTED}"; then
: "no differences detected"
else
echo Error parsing "$fn"
exit 1
fi
done
for fn in "${srcdir}"/testdata/*.jpg ; do
./test-parse$EXEEXT "${fn}" | tr -d '\015' | parse_canonicalize > "${TMPORIGINAL}"
./test-parse-from-data$EXEEXT "${fn}" | tr -d '\015' | parse_canonicalize > "${TMPEXTRACTED}"
if ${comparetool} "${TMPORIGINAL}" "${TMPEXTRACTED}"; then
echo "no differences detected"
else
echo "ERROR: Difference between test-parse and test-parse-from-data for $fn !"
exit 1
fi
done
+11 -3
View File
@@ -7,15 +7,23 @@
srcdir="${srcdir:-.}"
TMPLOG="$(mktemp)"
trap 'rm -f "${TMPLOG}"' 0
. ${srcdir}/inc-comparetool.sh
# Ensure that names are untranslated
LANG=
LANGUAGE=
LC_ALL=C
export LANG LANGUAGE LC_ALL
for fn in "${srcdir}"/testdata/*.jpg ; do
./test-parse "${fn}" > "${TMPLOG}"
if ! diff "${fn}".parsed "${TMPLOG}"; then
echo Error parsing "$fn"
# The *.parsed text files have LF line endings, so the tr removes
# the CR from CRLF line endings, while keeping LF line endings the
# same.
./test-parse$EXEEXT "${fn}" | tr -d '\015' > "${TMPLOG}"
if ${comparetool} "${fn}.parsed" "${TMPLOG}"; then
: "no differences detected"
else
echo "Error parsing $fn"
exit 1
fi
done
+10 -2
View File
@@ -7,14 +7,22 @@
srcdir="${srcdir:-.}"
TMPLOG="$(mktemp)"
trap 'rm -f "${TMPLOG}"' 0
. ${srcdir}/inc-comparetool.sh
# Ensure that names are untranslated
LANG=
LANGUAGE=
LC_ALL=C
export LANG LANGUAGE LC_ALL
for fn in "${srcdir}"/testdata/*.jpg ; do
./test-parse --swap-byte-order "${fn}" | sed -e '/^New byte order:/d' > "${TMPLOG}"
if ! diff "${fn}".parsed "${TMPLOG}"; then
# The *.parsed text files have LF line endings, so the tr removes
# the CR from CRLF line endings, while keeping LF line endings the
# same.
./test-parse$EXEEXT --swap-byte-order "${fn}" | tr -d '\015' | sed -e '/^New byte order:/d' > "${TMPLOG}"
if ${comparetool} "${fn}.parsed" "${TMPLOG}"; then
: "no differences detected"
else
echo Error parsing "$fn"
exit 1
fi
+9 -9
View File
@@ -258,7 +258,7 @@ Byte order: Intel
Entry 37: 1, (unknown)
Size: 6
Value: 0x0000
Entry 38: 1, (unknown)
Entry 38: 1, Spot Metering Mode
Size: 6
Value: 0x0000
Entry 39: 1, Photo Effect
@@ -321,13 +321,13 @@ Byte order: Intel
Entry 58: 4, Sequence Number
Size: 1
Value: 0
Entry 59: 4, (unknown)
Entry 59: 4, Optical Zoom Code
Size: 6
Value: 0x0000
Entry 60: 4, (unknown)
Size: 6
Value: 0x0000
Entry 61: 4, (unknown)
Entry 61: 4, Camera Temperature
Size: 6
Value: 0x0000
Entry 62: 4, Flash Guide Number
@@ -345,7 +345,7 @@ Byte order: Intel
Entry 66: 4, AE Bracket Value
Size: 7
Value: 0.00 EV
Entry 67: 4, (unknown)
Entry 67: 4, Control Mode
Size: 6
Value: 0x0001
Entry 68: 4, Focus Distance Upper
@@ -360,7 +360,7 @@ Byte order: Intel
Entry 71: 4, Exposure Time
Size: 1
Value: 1
Entry 72: 4, (unknown)
Entry 72: 4, Measured EV 2
Size: 6
Value: 0x0000
Entry 73: 4, Bulb Duration
@@ -399,10 +399,10 @@ Byte order: Intel
Entry 84: 0, (unknown)
Size: 8
Value: 0 0 0 0
Entry 85: 18, (unknown)
Entry 85: 18, AFInfo
Size: 101
Value: 9 9 640 480 3072 230 553 41 64982 0 554 64982 0 554 64982 0 554 65492 65492 65492 0 0 0 44 44 44 0 0
Entry 86: 19, (unknown)
Entry 86: 19, ThumbnailValidArea
Size: 8
Value: 0 0 0 0
Entry 87: 6, ImageType
@@ -417,7 +417,7 @@ Byte order: Intel
Entry 90: 9, OwnerName
Size: 0
Value:
Entry 91: 16, (unknown)
Entry 91: 16, ModelID
Size: 9
Value: 20447232
Entry 92: 0, (unknown)
@@ -429,6 +429,6 @@ Byte order: Intel
Entry 94: 25, (unknown)
Size: 2
Value: 1
Entry 95: 13, (unknown)
Entry 95: 13, CameraInfo
Size: 118
Value: 72 9 512 512 512 512 512 512 512 512 512 65 0 0 65125 2 0 10 65504 65488 0 43 161 0 48 992 1024 0 0 0 0 0 0 0 192 351
+3 -3
View File
@@ -198,7 +198,7 @@ Byte order: Intel
Entry 13: 26, (unknown)
Size: 40
Value:
Entry 14: 33, (unknown)
Entry 14: 33, FaceDetect
Size: 236
Value: 106 bytes unknown data: 00024001f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Entry 15: 38, (unknown)
@@ -231,7 +231,7 @@ Byte order: Intel
Entry 24: 143, (unknown)
Size: 15
Value:
Entry 25: 145, (unknown)
Entry 25: 145, ShotInfo
Size: 1984
Value: 980 bytes unknown data: 000000011100000000000000000000000000000000000002bc006700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300000400000500000600000700000800000900000a00000b00000c00000d00000e00000f00001000001100001200001300001400001500001600001700001800001900001a00001b00001c00001d00001e00001f00002000002100002200002300002400002500002600002700002800002900002a00002b00002c00002d00002e00002f00003000003100003200003300003400003500003600003700003800003900003a00003b00003c00003d00003e00003f00004000004100004200004300004400004500004600004700004800004900004a00004b00004c00004d00004e00004f00005000005100005200005300005400005500005600005700005800005900005a00005b00005c00005d00005e00005f00006000006100006200006300006400006500006600006700006800006900006a00006b00006c00006d00006e00006f00007000007100007200007300007400007500007600007700007800007900007a00007b00007c00007d00007e00007f00008000008100008200008300008400008500008600008700008800008900008a00008b00008c00008d00008e00008f00009000009100009200009300009400009500009600009700009800009900009a00009b00009c00009d00009e00009f0000a00000a10000a20000a30000a40000a50000a60000a70000a80000a90000aa0000ab0000ac0000ad0000ae0000af0000b00000b10000b20000b30000b40000b50000b60000b70000b80000b90000ba0000bb0000bc0000bd0000be0000bf0000c00000c10000c20000c30000c40000c50000c60000c70000c80000c90000ca0000cb0000cc0000cd0000ce0000cf0000d00000d10000d20000d30000d40000d50000d60000d70000d80000d90000da0000db0000dc0000dd0000de0000df0000e00000e10000e20000e30000e40000e50000e60000e70000e80000e90000ea0000eb0000ec0000ed0000ee0000ef0000f00000f10000f20000f30000f40000f50000f60000f70000f80000f90000fa0000fb0000fc0000fd0000fe0000ff0000
Entry 26: 148, Saturation
@@ -249,7 +249,7 @@ Byte order: Intel
Entry 30: 157, (unknown)
Size: 1
Value: 0
Entry 31: 158, (unknown)
Entry 31: 158, RetouchHistory
Size: 46
Value: Invalid number of components (10, expected 1).
Entry 32: 159, (unknown)