Mercurial > geeqie.yaz
annotate src/format_canon.c @ 281:9995c5fb202a
gqview.h -> main.h
author | zas_ |
---|---|
date | Tue, 08 Apr 2008 23:02:33 +0000 |
parents | 0ca3b4c8ffae |
children | 4b2d7f9af171 |
rev | line source |
---|---|
45 | 1 /* |
2 * GQView | |
3 * (C) 2005 John Ellis | |
4 * | |
5 * This software is released under the GNU General Public License (GNU GPL). | |
6 * Please read the included file COPYING for more information. | |
7 * This software comes with no warranty of any kind, use at your own risk! | |
8 * | |
9 * | |
10 * Code to add support for Canon CR2 and CRW files, version 0.2 | |
11 * | |
12 * Developed by Daniel M. German, dmgerman at uvic.ca | |
13 * | |
14 * you can find the sources for this patch at http://turingmachine.org/~dmg/libdcraw/gqview/ | |
15 * | |
16 */ | |
17 | |
18 #ifdef HAVE_CONFIG_H | |
19 # include "config.h" | |
20 #endif | |
21 | |
177 | 22 #ifndef HAVE_EXIV2 |
45 | 23 |
24 #include <stdio.h> | |
25 #include <string.h> | |
26 #include <unistd.h> | |
27 | |
28 #include <glib.h> | |
29 | |
30 #include "intl.h" | |
31 | |
281 | 32 #include "main.h" |
45 | 33 #include "format_canon.h" |
34 #include "format_raw.h" | |
35 | |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
36 #include "exif.h" |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
37 |
45 | 38 |
53
00843150f7c8
Tue Jun 7 03:47:03 2005 John Ellis <johne@verizon.net>
gqview
parents:
51
diff
changeset
|
39 /* |
00843150f7c8
Tue Jun 7 03:47:03 2005 John Ellis <johne@verizon.net>
gqview
parents:
51
diff
changeset
|
40 *----------------------------------------------------------------------------- |
00843150f7c8
Tue Jun 7 03:47:03 2005 John Ellis <johne@verizon.net>
gqview
parents:
51
diff
changeset
|
41 * Raw (CR2, CRW) embedded jpeg extraction for Canon |
00843150f7c8
Tue Jun 7 03:47:03 2005 John Ellis <johne@verizon.net>
gqview
parents:
51
diff
changeset
|
42 *----------------------------------------------------------------------------- |
00843150f7c8
Tue Jun 7 03:47:03 2005 John Ellis <johne@verizon.net>
gqview
parents:
51
diff
changeset
|
43 */ |
00843150f7c8
Tue Jun 7 03:47:03 2005 John Ellis <johne@verizon.net>
gqview
parents:
51
diff
changeset
|
44 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
45 static gint canon_cr2_tiff_entry(unsigned char *data, const guint len, guint offset, ExifByteOrder bo, |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
46 guint *image_offset, gint *jpeg_encoding) |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
47 { |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
48 guint tag; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
49 guint type; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
50 guint count; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
51 guint jpeg_start; |
45 | 52 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
53 /* the two (tiff compliant) tags we want are: |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
54 * 0x0103 image compression type (must be type 6 for jpeg) |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
55 * 0x0111 jpeg start offset |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
56 * only use the first segment that contains an actual jpeg - as there |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
57 * is a another that contains the raw data. |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
58 */ |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
59 tag = exif_byte_get_int16(data + offset + EXIF_TIFD_OFFSET_TAG, bo); |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
60 type = exif_byte_get_int16(data + offset + EXIF_TIFD_OFFSET_FORMAT, bo); |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
61 count = exif_byte_get_int32(data + offset + EXIF_TIFD_OFFSET_COUNT, bo); |
45 | 62 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
63 /* tag 0x0103 contains the compression type for this segment's image data */ |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
64 if (tag == 0x0103) |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
65 { |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
66 if (ExifFormatList[type].size * count == 2 && |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
67 exif_byte_get_int16(data + offset + EXIF_TIFD_OFFSET_DATA, bo) == 6) |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
68 { |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
69 *jpeg_encoding = TRUE; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
70 } |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
71 return FALSE; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
72 } |
45 | 73 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
74 /* find and verify jpeg offset */ |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
75 if (tag != 0x0111 || |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
76 !jpeg_encoding) return FALSE; |
45 | 77 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
78 /* make sure data segment contains 4 bytes */ |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
79 if (ExifFormatList[type].size * count != 4) return FALSE; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
80 |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
81 jpeg_start = exif_byte_get_int32(data + offset + EXIF_TIFD_OFFSET_DATA, bo); |
45 | 82 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
83 /* verify this is jpeg data */ |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
84 if (len < jpeg_start + 4 || |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
85 memcmp(data + jpeg_start, "\xff\xd8", 2) != 0) |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
86 { |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
87 return FALSE; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
88 } |
45 | 89 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
90 *image_offset = jpeg_start; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
91 return TRUE; |
45 | 92 } |
93 | |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
94 static gint canon_cr2_tiff_table(unsigned char *data, const guint len, guint offset, ExifByteOrder bo, |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
95 guint *image_offset) |
45 | 96 { |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
97 gint jpeg_encoding = FALSE; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
98 guint count; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
99 guint i; |
45 | 100 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
101 if (len < offset + 2) return 0; |
45 | 102 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
103 count = exif_byte_get_int16(data + offset, bo); |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
104 offset += 2; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
105 if (len < offset + count * EXIF_TIFD_SIZE + 4) return 0; |
45 | 106 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
107 for (i = 0; i < count; i++) |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
108 { |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
109 if (canon_cr2_tiff_entry(data, len, offset + i * EXIF_TIFD_SIZE, bo, |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
110 image_offset, &jpeg_encoding)) |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
111 { |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
112 return 0; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
113 } |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
114 } |
45 | 115 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
116 return exif_byte_get_int32(data + offset + count * EXIF_TIFD_SIZE, bo); |
45 | 117 } |
118 | |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
119 gint format_canon_raw_cr2(unsigned char *data, const guint len, |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
120 guint *image_offset, guint *exif_offset) |
45 | 121 { |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
122 guint jpeg_offset = 0; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
123 ExifByteOrder bo; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
124 guint offset; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
125 gint level; |
45 | 126 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
127 /* cr2 files are tiff files with a few canon specific directory tags |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
128 * they are (always ?) in little endian format |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
129 */ |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
130 if (!exif_tiff_directory_offset(data, len, &offset, &bo)) return FALSE; |
45 | 131 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
132 level = 0; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
133 while (offset && level < EXIF_TIFF_MAX_LEVELS) |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
134 { |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
135 offset = canon_cr2_tiff_table(data, len, offset, bo, &jpeg_offset); |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
136 level++; |
45 | 137 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
138 if (jpeg_offset != 0) |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
139 { |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
140 if (image_offset) *image_offset = jpeg_offset; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
141 return TRUE; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
142 } |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
143 } |
45 | 144 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
145 return FALSE; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
146 } |
45 | 147 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
148 #define CRW_BYTE_ORDER EXIF_BYTE_ORDER_INTEL |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
149 #define CRW_HEADER_SIZE 26 |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
150 #define CRW_DIR_ENTRY_SIZE 10 |
45 | 151 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
152 gint format_canon_raw_crw(unsigned char *data, const guint len, |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
153 guint *image_offset, guint *exif_offset) |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
154 { |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
155 guint block_offset; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
156 guint data_length; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
157 guint offset; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
158 guint count; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
159 guint i; |
45 | 160 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
161 /* CRW header starts with 2 bytes for byte order (always "II", little endian), |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
162 * 4 bytes for start of root block, |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
163 * and 8 bytes of magic for file type and format "HEAPCCDR" |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
164 * (also 4 bytes for file version, and 8 bytes reserved) |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
165 * |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
166 * CIFF specification in pdf format is available on some websites, |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
167 * search for "CIFFspecV1R03.pdf" or "CIFFspecV1R04.pdf" |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
168 */ |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
169 if (len < CRW_HEADER_SIZE || |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
170 memcmp(data, "II", 2) != 0 || |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
171 memcmp(data + 6, "HEAPCCDR", 8) != 0) |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
172 { |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
173 return FALSE; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
174 } |
45 | 175 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
176 block_offset = exif_byte_get_int32(data + 2, CRW_BYTE_ORDER); |
45 | 177 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
178 /* the end of the root block equals end of file, |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
179 * the last 4 bytes of the root block contain the block's data size |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
180 */ |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
181 offset = len - 4; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
182 data_length = exif_byte_get_int32(data + offset, CRW_BYTE_ORDER); |
45 | 183 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
184 offset = block_offset + data_length; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
185 if (len < offset + 2) return FALSE; |
45 | 186 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
187 /* number of directory entries for this block is in |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
188 * the next two bytes after the data for this block. |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
189 */ |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
190 count = exif_byte_get_int16(data + offset, CRW_BYTE_ORDER); |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
191 offset += 2; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
192 if (len < offset + count * CRW_DIR_ENTRY_SIZE + 4) return FALSE; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
193 |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
194 /* walk the directory entries looking for type jpeg (tag 0x2007), |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
195 * for reference, other tags are 0x2005 for raw and 0x300a for photo info: |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
196 */ |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
197 for (i = 0; i < count ; i++) |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
198 { |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
199 guint entry_offset; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
200 guint record_type; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
201 guint record_offset; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
202 guint record_length; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
203 |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
204 entry_offset = offset + i * CRW_DIR_ENTRY_SIZE; |
45 | 205 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
206 /* entry is 10 bytes (in order): |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
207 * 2 for type |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
208 * 4 for length of data |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
209 * 4 for offset into data segment of this block |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
210 */ |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
211 record_type = exif_byte_get_int16(data + entry_offset, CRW_BYTE_ORDER); |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
212 record_length = exif_byte_get_int32(data + entry_offset + 2, CRW_BYTE_ORDER); |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
213 record_offset = exif_byte_get_int32(data + entry_offset + 6, CRW_BYTE_ORDER); |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
214 |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
215 /* tag we want for jpeg data */ |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
216 if (record_type == 0x2007) |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
217 { |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
218 guint jpeg_offset; |
45 | 219 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
220 jpeg_offset = block_offset + record_offset; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
221 if (len < jpeg_offset + record_length || |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
222 record_length < 4 || |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
223 memcmp(data + jpeg_offset, "\xff\xd8\xff\xdb", 4) != 0) |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
224 { |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
225 return FALSE; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
226 } |
45 | 227 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
228 /* we now know offset and verified jpeg */ |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
229 *image_offset = jpeg_offset; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
230 return TRUE; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
231 } |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
232 } |
45 | 233 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
234 return FALSE; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
235 } |
45 | 236 |
237 | |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
238 /* |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
239 *----------------------------------------------------------------------------- |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
240 * EXIF Makernote for Canon |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
241 *----------------------------------------------------------------------------- |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
242 */ |
45 | 243 |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
244 static ExifTextList CanonSet1MacroMode[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
245 { 1, "macro" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
246 { 2, "normal" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
247 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
248 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
249 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
250 static ExifTextList CanonSet1Quality[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
251 { 2, "normal" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
252 { 3, "fine" }, |
54
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
253 { 4, "raw" }, |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
254 { 5, "superfine" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
255 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
256 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
257 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
258 static ExifTextList CanonSet1FlashMode[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
259 { 0, "flash not fired" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
260 { 1, "auto" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
261 { 2, "on" }, |
54
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
262 { 3, "red-eye reduction" }, |
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
263 { 4, "slow sync" }, |
57
a8c9992320f4
Fri Jun 10 20:57:42 2005 John Ellis <johne@verizon.net>
gqview
parents:
54
diff
changeset
|
264 { 5, "auto + red-eye reduction" }, |
a8c9992320f4
Fri Jun 10 20:57:42 2005 John Ellis <johne@verizon.net>
gqview
parents:
54
diff
changeset
|
265 { 6, "on + red-eye reduction" }, |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
266 { 16, "external flash" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
267 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
268 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
269 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
270 static ExifTextList CanonSet1DriveMode[] = { |
57
a8c9992320f4
Fri Jun 10 20:57:42 2005 John Ellis <johne@verizon.net>
gqview
parents:
54
diff
changeset
|
271 { 0, "single or timer" }, |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
272 { 1, "continuous" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
273 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
274 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
275 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
276 static ExifTextList CanonSet1FocusMode[] = { |
54
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
277 { 0, "one-shot AF" }, |
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
278 { 1, "AI servo AF" }, |
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
279 { 2, "AI focus AF" }, |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
280 { 3, "manual" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
281 { 4, "single" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
282 { 5, "continuous" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
283 { 6, "manual" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
284 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
285 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
286 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
287 static ExifTextList CanonSet1ImageSize[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
288 { 0, "large" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
289 { 1, "medium" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
290 { 2, "small" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
291 /* where (or) does Medium 1/2 fit in here ? */ |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
292 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
293 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
294 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
295 static ExifTextList CanonSet1ShootingMode[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
296 { 0, "auto" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
297 { 1, "manual" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
298 { 2, "landscape" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
299 { 3, "fast shutter" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
300 { 4, "slow shutter" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
301 { 5, "night" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
302 { 6, "black and white" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
303 { 7, "sepia" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
304 { 8, "portrait" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
305 { 9, "sports" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
306 { 10, "macro" }, |
57
a8c9992320f4
Fri Jun 10 20:57:42 2005 John Ellis <johne@verizon.net>
gqview
parents:
54
diff
changeset
|
307 { 11, "pan focus" }, |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
308 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
309 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
310 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
311 /* Don't think this is interpreted correctly/completely, A60 at 2.5x Digital sets value of 3 */ |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
312 static ExifTextList CanonSet1DigitalZoom[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
313 { 0, "none" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
314 { 1, "2x" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
315 { 2, "4x" }, |
54
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
316 { 3, "other" }, |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
317 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
318 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
319 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
320 static ExifTextList CanonSet1ConSatSharp[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
321 { 0, "normal" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
322 { 1, "high" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
323 { 65535,"low" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
324 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
325 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
326 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
327 static ExifTextList CanonSet1ISOSpeed[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
328 /* { 0, "not set/see EXIF tag" }, */ |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
329 { 15, "auto" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
330 { 16, "50" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
331 { 17, "100" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
332 { 18, "200" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
333 { 19, "400" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
334 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
335 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
336 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
337 static ExifTextList CanonSet1MeteringMode[] = { |
54
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
338 { 0, "default" }, |
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
339 { 1, "spot" }, |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
340 { 3, "evaluative" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
341 { 4, "partial" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
342 { 5, "center-weighted" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
343 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
344 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
345 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
346 static ExifTextList CanonSet1FocusType[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
347 { 0, "manual" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
348 { 1, "auto" }, |
54
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
349 { 2, "auto" }, |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
350 { 3, "macro" }, |
54
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
351 { 7, "infinity" }, |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
352 { 8, "locked" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
353 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
354 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
355 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
356 static ExifTextList CanonSet1AutoFocusPoint[] = { |
54
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
357 { 0x2005, "manual AF point selection" }, |
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
358 { 0x3000, "manual focus" }, |
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
359 { 0x3001, "auto" }, |
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
360 { 0x3002, "right" }, |
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
361 { 0x3003, "center" }, |
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
362 { 0x3004, "left" }, |
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
363 { 0x4001, "auto AF point selection" }, |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
364 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
365 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
366 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
367 static ExifTextList CanonSet1ExposureMode[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
368 { 0, "auto" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
369 { 1, "program" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
370 { 2, "Tv priority" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
371 { 3, "Av priority" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
372 { 4, "manual" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
373 { 5, "A-DEP" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
374 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
375 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
376 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
377 static ExifTextList CanonSet1FlashFired[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
378 { 0, "no" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
379 { 1, "yes" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
380 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
381 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
382 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
383 static ExifTextList CanonSet1FocusCont[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
384 { 0, "no (single)" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
385 { 1, "yes" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
386 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
387 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
388 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
389 static ExifMarker CanonSet1[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
390 /* 0 is length of array in bytes (2 x array size) */ |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
391 { 1, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.MacroMode", "Macro mode", CanonSet1MacroMode }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
392 { 2, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.SelfTimer", "Self timer (10ths of second)", NULL }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
393 { 3, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.Quality", "Quality", CanonSet1Quality }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
394 { 4, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.FlashMode", "Flash mode", CanonSet1FlashMode }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
395 { 5, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.DriveMode", "Drive mode", CanonSet1DriveMode }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
396 { 7, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.FocusMode", "Focus mode", CanonSet1FocusMode }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
397 { 10, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.ImageSize", "Image size", CanonSet1ImageSize }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
398 { 11, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.ShootingMode","Shooting mode", CanonSet1ShootingMode }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
399 { 11, EXIF_FORMAT_SHORT_UNSIGNED, 1, "ExposureProgram", "ExposureProgram", CanonSet1ShootingMode }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
400 { 12, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.DigitalZoom", "Digital zoom", CanonSet1DigitalZoom }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
401 { 13, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.Contrast", "Contrast", CanonSet1ConSatSharp }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
402 { 14, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.Saturation", "Saturation", CanonSet1ConSatSharp }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
403 { 15, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.Sharpness", "Sharpness", CanonSet1ConSatSharp }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
404 { 16, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.ISOSpeed", "ISO speed", CanonSet1ISOSpeed }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
405 { 16, EXIF_FORMAT_SHORT_UNSIGNED, 1, "ISOSpeedRatings", "ISO speed", CanonSet1ISOSpeed }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
406 { 17, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.MeteringMode","Metering mode", CanonSet1MeteringMode }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
407 { 18, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.FocusType", "Focus type", CanonSet1FocusType }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
408 { 19, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.AutoFocus", "AutoFocus point", CanonSet1AutoFocusPoint }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
409 { 20, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.ExposureMode","Exposure mode", CanonSet1ExposureMode }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
410 { 20, EXIF_FORMAT_SHORT_UNSIGNED, 1, "ExposureMode", "Exposure mode", CanonSet1ExposureMode }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
411 { 23, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.FocalLengthLong","Long focal length", NULL }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
412 { 24, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.FocalLengthShort","Short focal length", NULL }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
413 { 25, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.FocalLengthUnits","Focal units per mm", NULL }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
414 { 28, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.FlashFired", "Flash fired", CanonSet1FlashFired }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
415 { 29, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.FlashDetails","Flash details", NULL }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
416 { 32, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.ContinuousFocus","Continuous focus", CanonSet1FocusCont }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
417 EXIF_MARKER_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
418 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
419 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
420 static ExifTextList CanonSet2WhiteBalance[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
421 { 0, "auto" }, |
57
a8c9992320f4
Fri Jun 10 20:57:42 2005 John Ellis <johne@verizon.net>
gqview
parents:
54
diff
changeset
|
422 { 1, "sunny" }, |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
423 { 2, "cloudy" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
424 { 3, "tungsten" }, |
54
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
425 { 4, "fluorescent" }, |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
426 { 5, "flash" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
427 { 6, "custom" }, |
54
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
428 { 7, "black and white" }, |
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
429 { 8, "shade" }, |
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
430 { 9, "manual" }, |
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
431 { 14, "daylight fluorescent" }, |
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
432 { 17, "underwater" }, |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
433 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
434 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
435 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
436 static ExifTextList CanonSet2FlashBias[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
437 { 0x0000, "0" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
438 { 0x000c, "0.33" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
439 { 0x0010, "0.5" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
440 { 0x0014, "0.67" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
441 { 0x0020, "1" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
442 { 0x002c, "1.33" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
443 { 0x0030, "1.5" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
444 { 0x0034, "1.67" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
445 { 0x0040, "2" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
446 { 0xffc0, "-2" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
447 { 0xffcc, "-1.67" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
448 { 0xffd0, "-1.5" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
449 { 0xffd4, "-1.33" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
450 { 0xffe0, "-1" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
451 { 0xffec, "-0.67" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
452 { 0xfff0, "-0.5" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
453 { 0xfff4, "-0.33" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
454 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
455 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
456 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
457 static ExifMarker CanonSet2[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
458 /* 0 is length of array in bytes (2 x array size) */ |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
459 { 7, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.WhiteBalance","White balance", CanonSet2WhiteBalance }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
460 { 7, EXIF_FORMAT_SHORT_UNSIGNED, 1, "LightSource", "White balance", CanonSet2WhiteBalance }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
461 { 9, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.SequenceNumber","Sequence number", NULL }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
462 { 15, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.FlashBias", "Flash bias", CanonSet2FlashBias }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
463 /* distance needs more than just this (metric) value */ |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
464 { 19, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.SubjectDistance", "Subject Distance", NULL }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
465 EXIF_MARKER_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
466 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
467 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
468 #if 0 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
469 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
470 static ExifTextList CanonCustomEnable[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
471 { 0, "off" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
472 { 1, "on" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
473 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
474 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
475 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
476 static ExifTextList CanonCustomEnableInvert[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
477 { 0, "on" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
478 { 1, "off" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
479 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
480 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
481 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
482 static ExifTextList CanonCustomExposureLevel[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
483 { 0, "1/2 stop" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
484 { 1, "1/3 stop" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
485 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
486 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
487 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
488 static ExifTextList CanonCustomAVShutterSpeed[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
489 { 0, "auto" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
490 { 1, "1/200 (fixed)" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
491 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
492 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
493 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
494 static ExifTextList CanonCustomShutterCurtainSync[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
495 { 0, "1st" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
496 { 1, "2nd" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
497 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
498 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
499 |
51
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
50
diff
changeset
|
500 static ExifMarker CanonCustom[] = { |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
50
diff
changeset
|
501 { 1, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.NoiseReduction", "Noise reduction", CanonCustomEnable }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
50
diff
changeset
|
502 /*{ 2, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.BtnFuncShutter", |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
50
diff
changeset
|
503 "Shutter/Auto exposure button function",CanonCustomBTNShutter }, */ |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
50
diff
changeset
|
504 { 3, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.MirrorLockup", "Mirror lockup", CanonCustomEnable }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
50
diff
changeset
|
505 { 4, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.TvAvExposureLevel", |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
50
diff
changeset
|
506 "Tv/Av and exposure level", CanonCustomExposureLevel }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
50
diff
changeset
|
507 { 5, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.AFAssistLight", "AF assist light", CanonCustomEnableInvert }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
50
diff
changeset
|
508 { 6, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.AvShutterSpeed", |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
50
diff
changeset
|
509 "Shutter speed in Av mode", CanonCustomAVShutterSpeed }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
50
diff
changeset
|
510 /*{ 7, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.AutoBracket", |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
50
diff
changeset
|
511 "Auto-Exposure bracketting sequence/auto cancellation", CanonCustom }, */ |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
50
diff
changeset
|
512 { 8, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.ShutterSync", "Shutter sync", CanonCustomShutterCurtainSync }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
50
diff
changeset
|
513 /* { 9, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.BtnFuncAF", "AF button function", CanonCustom }, */ |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
50
diff
changeset
|
514 { 10, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.FillFlashReduction", |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
50
diff
changeset
|
515 "Fill flash auto reduction", CanonCustomEnableInvert }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
50
diff
changeset
|
516 /*{ 11, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.BtnFuncMenu", |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
50
diff
changeset
|
517 "Menu button function", CanonCustom }, */ |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
50
diff
changeset
|
518 /*{ 12, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.BtnFuncSet", "Set button function", CanonCustom }, */ |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
50
diff
changeset
|
519 { 13, EXIF_FORMAT_SHORT_UNSIGNED, 1, "MkN.Canon.SensorCleaning", "Sensor cleaning", CanonCustomEnable }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
50
diff
changeset
|
520 EXIF_MARKER_LIST_END |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
521 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
522 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
523 #endif |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
524 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
525 static ExifMarker CanonExifMarkersList[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
526 { 1, EXIF_FORMAT_SHORT_UNSIGNED, -1, "MkN.Canon.Settings1", NULL, NULL }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
527 { 4, EXIF_FORMAT_SHORT_UNSIGNED, -1, "MkN.Canon.Settings2", NULL, NULL }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
528 { 6, EXIF_FORMAT_STRING, -1, "MkN.Canon.ImageType", "Image type", NULL }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
529 { 7, EXIF_FORMAT_STRING, -1, "MkN.Canon.FirmwareVersion", "Firmware version", NULL }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
530 { 8, EXIF_FORMAT_LONG_UNSIGNED, 1, "MkN.Canon.ImageNumber", "Image number", NULL }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
531 { 9, EXIF_FORMAT_STRING, -1, "MkN.Canon.OwnerName", "Owner name", NULL }, |
48
6948407f52a5
Fri Jun 3 18:43:46 2005 John Ellis <johne@verizon.net>
gqview
parents:
47
diff
changeset
|
532 { 12, EXIF_FORMAT_LONG_UNSIGNED, -1, "MkN.Canon.SerialNumber", "Camera serial number", NULL }, |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
533 { 15, EXIF_FORMAT_SHORT_UNSIGNED, -1, "MkN.Canon.CustomFunctions", NULL, NULL }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
534 EXIF_MARKER_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
535 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
536 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
537 static void canon_mknote_parse_settings(ExifData *exif, |
54
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
538 guint16 *data, guint32 len, ExifByteOrder bo, |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
539 ExifMarker *list) |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
540 { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
541 gint i; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
542 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
543 i = 0; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
544 while (list[i].tag != 0) |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
545 { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
546 if (list[i].tag < len) |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
547 { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
548 ExifItem *item; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
549 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
550 item = exif_item_new(EXIF_FORMAT_SHORT_UNSIGNED, list[i].tag, 1, &list[i]); |
54
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
551 exif_item_copy_data(item, &data[list[i].tag], 2, EXIF_FORMAT_SHORT_UNSIGNED, bo); |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
552 exif->items = g_list_prepend(exif->items, item); |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
553 } |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
554 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
555 i++; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
556 } |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
557 } |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
558 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
559 #if 0 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
560 static void canon_mknote_parse_convert(ExifData *exif) |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
561 { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
562 gint value; |
48
6948407f52a5
Fri Jun 3 18:43:46 2005 John Ellis <johne@verizon.net>
gqview
parents:
47
diff
changeset
|
563 ExifItem *result; |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
564 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
565 /* seems we need more than only this value for distance */ |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
566 if (exif_get_integer(exif, "MkN.Canon.SubjectDistance", &value)) |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
567 { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
568 static ExifMarker marker= { 0x9206, EXIF_FORMAT_RATIONAL_UNSIGNED, 1, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
569 "SubjectDistance", "Subject distance", NULL }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
570 ExifItem *item; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
571 ExifRational *rational; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
572 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
573 item = exif_item_new(marker.format, marker.tag, 1, &marker); |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
574 rational = item->data; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
575 rational->num = value; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
576 rational->den = 100; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
577 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
578 exif->items = g_list_prepend(exif->items, item); |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
579 } |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
580 |
48
6948407f52a5
Fri Jun 3 18:43:46 2005 John Ellis <johne@verizon.net>
gqview
parents:
47
diff
changeset
|
581 result = exif_get_item(exif, "MkN.Canon.SerialNumber"); |
6948407f52a5
Fri Jun 3 18:43:46 2005 John Ellis <johne@verizon.net>
gqview
parents:
47
diff
changeset
|
582 if (result && result->format == EXIF_FORMAT_LONG_UNSIGNED && result->data_len == 4) |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
583 { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
584 static ExifMarker marker= { 12, EXIF_FORMAT_STRING, -1, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
585 "SerialNumber", "Camera serial number", NULL }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
586 ExifItem *item; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
587 gchar *text; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
588 gint l; |
48
6948407f52a5
Fri Jun 3 18:43:46 2005 John Ellis <johne@verizon.net>
gqview
parents:
47
diff
changeset
|
589 guint32 n; |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
590 |
49
ae627d150a6b
Fri Jun 3 20:02:23 2005 John Ellis <johne@verizon.net>
gqview
parents:
48
diff
changeset
|
591 n = (guint32)((guint32 *)(result->data))[0]; |
48
6948407f52a5
Fri Jun 3 18:43:46 2005 John Ellis <johne@verizon.net>
gqview
parents:
47
diff
changeset
|
592 text = g_strdup_printf("%04X%05d", n & 0xffff0000 >> 8, n & 0x0000ffff); |
57
a8c9992320f4
Fri Jun 10 20:57:42 2005 John Ellis <johne@verizon.net>
gqview
parents:
54
diff
changeset
|
593 l = strlen(text) + 1; |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
594 item = exif_item_new(marker.format, marker.tag, l, &marker); |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
595 memcpy(item->data, text, l); |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
596 g_free(text); |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
597 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
598 exif->items = g_list_prepend(exif->items, item); |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
599 } |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
600 } |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
601 #endif |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
602 |
51
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
50
diff
changeset
|
603 gint format_canon_makernote(ExifData *exif, unsigned char *tiff, guint offset, |
54
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
604 guint size, ExifByteOrder bo) |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
605 { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
606 ExifItem *item; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
607 |
54
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
608 if (exif_parse_IFD_table(exif, tiff, offset, size, bo, 0, CanonExifMarkersList) != 0) |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
609 { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
610 return FALSE; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
611 } |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
612 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
613 item = exif_get_item(exif, "MkN.Canon.Settings1"); |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
614 if (item) |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
615 { |
54
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
616 canon_mknote_parse_settings(exif, item->data, item->data_len, bo, CanonSet1); |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
617 } |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
618 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
619 item = exif_get_item(exif, "MkN.Canon.Settings2"); |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
620 if (item) |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
621 { |
54
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
622 canon_mknote_parse_settings(exif, item->data, item->data_len, bo, CanonSet2); |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
623 } |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
624 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
625 #if 0 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
626 canon_mknote_parse_convert(exif); |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
627 #endif |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
628 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
629 return TRUE; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
630 } |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
631 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
632 |
177 | 633 #endif |
634 /* not HAVE_EXIV2 */ |