Mercurial > geeqie.yaz
annotate src/format_canon.c @ 61:0c912a2d94f1
Mon Jun 13 20:22:58 2005 John Ellis <johne@verizon.net>
* image.c (image_zoom_cb): If needed, update window title when
zoom changes.
* pixbuf-renderer.c (pr_size_sync): Send zoom signal when new window
size results in a new scale value.
* README: Updates.
* configure.in: Release 2.1.1
author | gqview |
---|---|
date | Tue, 14 Jun 2005 00:49:25 +0000 |
parents | 57f6da2510d9 |
children | 71e1ebee420e |
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 | |
22 | |
23 #include <stdio.h> | |
24 #include <string.h> | |
25 #include <unistd.h> | |
26 | |
27 #include <glib.h> | |
28 | |
29 #include "intl.h" | |
30 | |
31 #include "format_canon.h" | |
32 #include "format_raw.h" | |
33 | |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
34 #include "exif.h" |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
35 |
45 | 36 |
53
00843150f7c8
Tue Jun 7 03:47:03 2005 John Ellis <johne@verizon.net>
gqview
parents:
51
diff
changeset
|
37 /* |
00843150f7c8
Tue Jun 7 03:47:03 2005 John Ellis <johne@verizon.net>
gqview
parents:
51
diff
changeset
|
38 *----------------------------------------------------------------------------- |
00843150f7c8
Tue Jun 7 03:47:03 2005 John Ellis <johne@verizon.net>
gqview
parents:
51
diff
changeset
|
39 * 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
|
40 *----------------------------------------------------------------------------- |
00843150f7c8
Tue Jun 7 03:47:03 2005 John Ellis <johne@verizon.net>
gqview
parents:
51
diff
changeset
|
41 */ |
00843150f7c8
Tue Jun 7 03:47:03 2005 John Ellis <johne@verizon.net>
gqview
parents:
51
diff
changeset
|
42 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
43 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
|
44 guint *image_offset, gint *jpeg_encoding) |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
45 { |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
46 guint tag; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
47 guint type; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
48 guint count; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
49 guint jpeg_start; |
45 | 50 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
51 /* 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
|
52 * 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
|
53 * 0x0111 jpeg start offset |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
54 * 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
|
55 * 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
|
56 */ |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
57 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
|
58 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
|
59 count = exif_byte_get_int32(data + offset + EXIF_TIFD_OFFSET_COUNT, bo); |
45 | 60 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
61 /* 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
|
62 if (tag == 0x0103) |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
63 { |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
64 if (ExifFormatList[type].size * count == 2 && |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
65 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
|
66 { |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
67 *jpeg_encoding = TRUE; |
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 return FALSE; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
70 } |
45 | 71 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
72 /* find and verify jpeg offset */ |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
73 if (tag != 0x0111 || |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
74 !jpeg_encoding) return FALSE; |
45 | 75 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
76 /* 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
|
77 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
|
78 |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
79 jpeg_start = exif_byte_get_int32(data + offset + EXIF_TIFD_OFFSET_DATA, bo); |
45 | 80 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
81 /* verify this is jpeg data */ |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
82 if (len < jpeg_start + 4 || |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
83 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
|
84 { |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
85 return FALSE; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
86 } |
45 | 87 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
88 *image_offset = jpeg_start; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
89 return TRUE; |
45 | 90 } |
91 | |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
92 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
|
93 guint *image_offset) |
45 | 94 { |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
95 gint jpeg_encoding = FALSE; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
96 guint count; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
97 guint i; |
45 | 98 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
99 if (len < offset + 2) return 0; |
45 | 100 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
101 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
|
102 offset += 2; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
103 if (len < offset + count * EXIF_TIFD_SIZE + 4) return 0; |
45 | 104 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
105 for (i = 0; i < count; i++) |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
106 { |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
107 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
|
108 image_offset, &jpeg_encoding)) |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
109 { |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
110 return 0; |
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 } |
45 | 113 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
114 return exif_byte_get_int32(data + offset + count * EXIF_TIFD_SIZE, bo); |
45 | 115 } |
116 | |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
117 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
|
118 guint *image_offset, guint *exif_offset) |
45 | 119 { |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
120 guint jpeg_offset = 0; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
121 ExifByteOrder bo; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
122 guint offset; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
123 gint level; |
45 | 124 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
125 /* 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
|
126 * 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
|
127 */ |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
128 if (!exif_tiff_directory_offset(data, len, &offset, &bo)) return FALSE; |
45 | 129 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
130 level = 0; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
131 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
|
132 { |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
133 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
|
134 level++; |
45 | 135 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
136 if (jpeg_offset != 0) |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
137 { |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
138 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
|
139 return TRUE; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
140 } |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
141 } |
45 | 142 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
143 return FALSE; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
144 } |
45 | 145 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
146 #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
|
147 #define CRW_HEADER_SIZE 26 |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
148 #define CRW_DIR_ENTRY_SIZE 10 |
45 | 149 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
150 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
|
151 guint *image_offset, guint *exif_offset) |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
152 { |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
153 guint block_offset; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
154 guint data_length; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
155 guint offset; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
156 guint count; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
157 guint i; |
45 | 158 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
159 /* 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
|
160 * 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
|
161 * 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
|
162 * (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
|
163 * |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
164 * 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
|
165 * 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
|
166 */ |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
167 if (len < CRW_HEADER_SIZE || |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
168 memcmp(data, "II", 2) != 0 || |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
169 memcmp(data + 6, "HEAPCCDR", 8) != 0) |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
170 { |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
171 return FALSE; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
172 } |
45 | 173 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
174 block_offset = exif_byte_get_int32(data + 2, CRW_BYTE_ORDER); |
45 | 175 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
176 /* 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
|
177 * 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
|
178 */ |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
179 offset = len - 4; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
180 data_length = exif_byte_get_int32(data + offset, CRW_BYTE_ORDER); |
45 | 181 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
182 offset = block_offset + data_length; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
183 if (len < offset + 2) return FALSE; |
45 | 184 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
185 /* 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
|
186 * 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
|
187 */ |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
188 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
|
189 offset += 2; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
190 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
|
191 |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
192 /* 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
|
193 * 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
|
194 */ |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
195 for (i = 0; i < count ; i++) |
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 guint entry_offset; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
198 guint record_type; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
199 guint record_offset; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
200 guint record_length; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
201 |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
202 entry_offset = offset + i * CRW_DIR_ENTRY_SIZE; |
45 | 203 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
204 /* entry is 10 bytes (in order): |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
205 * 2 for type |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
206 * 4 for length of data |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
207 * 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
|
208 */ |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
209 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
|
210 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
|
211 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
|
212 |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
213 /* tag we want for jpeg data */ |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
214 if (record_type == 0x2007) |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
215 { |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
216 guint jpeg_offset; |
45 | 217 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
218 jpeg_offset = block_offset + record_offset; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
219 if (len < jpeg_offset + record_length || |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
220 record_length < 4 || |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
221 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
|
222 { |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
223 return FALSE; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
224 } |
45 | 225 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
226 /* 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
|
227 *image_offset = jpeg_offset; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
228 return TRUE; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
229 } |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
230 } |
45 | 231 |
59
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
232 return FALSE; |
57f6da2510d9
Sun Jun 12 19:25:26 2005 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
233 } |
45 | 234 |
235 | |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
236 /* |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
237 *----------------------------------------------------------------------------- |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
238 * EXIF Makernote for Canon |
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 */ |
45 | 241 |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
242 static ExifTextList CanonSet1MacroMode[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
243 { 1, "macro" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
244 { 2, "normal" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
245 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
246 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
247 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
248 static ExifTextList CanonSet1Quality[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
249 { 2, "normal" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
250 { 3, "fine" }, |
54
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
251 { 4, "raw" }, |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
252 { 5, "superfine" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
253 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
254 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
255 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
256 static ExifTextList CanonSet1FlashMode[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
257 { 0, "flash not fired" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
258 { 1, "auto" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
259 { 2, "on" }, |
54
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
260 { 3, "red-eye reduction" }, |
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
261 { 4, "slow sync" }, |
57
a8c9992320f4
Fri Jun 10 20:57:42 2005 John Ellis <johne@verizon.net>
gqview
parents:
54
diff
changeset
|
262 { 5, "auto + red-eye reduction" }, |
a8c9992320f4
Fri Jun 10 20:57:42 2005 John Ellis <johne@verizon.net>
gqview
parents:
54
diff
changeset
|
263 { 6, "on + red-eye reduction" }, |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
264 { 16, "external flash" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
265 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
266 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
267 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
268 static ExifTextList CanonSet1DriveMode[] = { |
57
a8c9992320f4
Fri Jun 10 20:57:42 2005 John Ellis <johne@verizon.net>
gqview
parents:
54
diff
changeset
|
269 { 0, "single or timer" }, |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
270 { 1, "continuous" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
271 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
272 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
273 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
274 static ExifTextList CanonSet1FocusMode[] = { |
54
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
275 { 0, "one-shot AF" }, |
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
276 { 1, "AI servo AF" }, |
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
277 { 2, "AI focus AF" }, |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
278 { 3, "manual" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
279 { 4, "single" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
280 { 5, "continuous" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
281 { 6, "manual" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
282 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
283 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
284 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
285 static ExifTextList CanonSet1ImageSize[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
286 { 0, "large" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
287 { 1, "medium" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
288 { 2, "small" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
289 /* 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
|
290 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
291 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
292 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
293 static ExifTextList CanonSet1ShootingMode[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
294 { 0, "auto" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
295 { 1, "manual" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
296 { 2, "landscape" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
297 { 3, "fast shutter" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
298 { 4, "slow shutter" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
299 { 5, "night" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
300 { 6, "black and white" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
301 { 7, "sepia" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
302 { 8, "portrait" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
303 { 9, "sports" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
304 { 10, "macro" }, |
57
a8c9992320f4
Fri Jun 10 20:57:42 2005 John Ellis <johne@verizon.net>
gqview
parents:
54
diff
changeset
|
305 { 11, "pan focus" }, |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
306 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
307 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
308 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
309 /* 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
|
310 static ExifTextList CanonSet1DigitalZoom[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
311 { 0, "none" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
312 { 1, "2x" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
313 { 2, "4x" }, |
54
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
314 { 3, "other" }, |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
315 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
316 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
317 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
318 static ExifTextList CanonSet1ConSatSharp[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
319 { 0, "normal" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
320 { 1, "high" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
321 { 65535,"low" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
322 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
323 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
324 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
325 static ExifTextList CanonSet1ISOSpeed[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
326 /* { 0, "not set/see EXIF tag" }, */ |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
327 { 15, "auto" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
328 { 16, "50" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
329 { 17, "100" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
330 { 18, "200" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
331 { 19, "400" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
332 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
333 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
334 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
335 static ExifTextList CanonSet1MeteringMode[] = { |
54
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
336 { 0, "default" }, |
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
337 { 1, "spot" }, |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
338 { 3, "evaluative" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
339 { 4, "partial" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
340 { 5, "center-weighted" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
341 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
342 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
343 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
344 static ExifTextList CanonSet1FocusType[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
345 { 0, "manual" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
346 { 1, "auto" }, |
54
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
347 { 2, "auto" }, |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
348 { 3, "macro" }, |
54
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
349 { 7, "infinity" }, |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
350 { 8, "locked" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
351 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
352 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
353 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
354 static ExifTextList CanonSet1AutoFocusPoint[] = { |
54
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
355 { 0x2005, "manual AF point selection" }, |
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
356 { 0x3000, "manual focus" }, |
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
357 { 0x3001, "auto" }, |
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
358 { 0x3002, "right" }, |
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
359 { 0x3003, "center" }, |
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
360 { 0x3004, "left" }, |
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
361 { 0x4001, "auto AF point selection" }, |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
362 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
363 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
364 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
365 static ExifTextList CanonSet1ExposureMode[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
366 { 0, "auto" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
367 { 1, "program" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
368 { 2, "Tv priority" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
369 { 3, "Av priority" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
370 { 4, "manual" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
371 { 5, "A-DEP" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
372 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
373 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
374 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
375 static ExifTextList CanonSet1FlashFired[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
376 { 0, "no" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
377 { 1, "yes" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
378 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
379 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
380 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
381 static ExifTextList CanonSet1FocusCont[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
382 { 0, "no (single)" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
383 { 1, "yes" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
384 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
385 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
386 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
387 static ExifMarker CanonSet1[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
388 /* 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
|
389 { 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
|
390 { 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
|
391 { 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
|
392 { 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
|
393 { 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
|
394 { 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
|
395 { 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
|
396 { 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
|
397 { 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
|
398 { 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
|
399 { 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
|
400 { 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
|
401 { 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
|
402 { 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
|
403 { 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
|
404 { 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
|
405 { 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
|
406 { 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
|
407 { 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
|
408 { 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
|
409 { 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
|
410 { 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
|
411 { 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
|
412 { 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
|
413 { 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
|
414 { 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
|
415 EXIF_MARKER_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
416 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
417 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
418 static ExifTextList CanonSet2WhiteBalance[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
419 { 0, "auto" }, |
57
a8c9992320f4
Fri Jun 10 20:57:42 2005 John Ellis <johne@verizon.net>
gqview
parents:
54
diff
changeset
|
420 { 1, "sunny" }, |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
421 { 2, "cloudy" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
422 { 3, "tungsten" }, |
54
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
423 { 4, "fluorescent" }, |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
424 { 5, "flash" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
425 { 6, "custom" }, |
54
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
426 { 7, "black and white" }, |
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
427 { 8, "shade" }, |
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
428 { 9, "manual" }, |
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
429 { 14, "daylight fluorescent" }, |
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
430 { 17, "underwater" }, |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
431 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
432 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
433 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
434 static ExifTextList CanonSet2FlashBias[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
435 { 0x0000, "0" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
436 { 0x000c, "0.33" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
437 { 0x0010, "0.5" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
438 { 0x0014, "0.67" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
439 { 0x0020, "1" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
440 { 0x002c, "1.33" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
441 { 0x0030, "1.5" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
442 { 0x0034, "1.67" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
443 { 0x0040, "2" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
444 { 0xffc0, "-2" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
445 { 0xffcc, "-1.67" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
446 { 0xffd0, "-1.5" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
447 { 0xffd4, "-1.33" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
448 { 0xffe0, "-1" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
449 { 0xffec, "-0.67" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
450 { 0xfff0, "-0.5" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
451 { 0xfff4, "-0.33" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
452 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
453 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
454 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
455 static ExifMarker CanonSet2[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
456 /* 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
|
457 { 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
|
458 { 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
|
459 { 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
|
460 { 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
|
461 /* 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
|
462 { 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
|
463 EXIF_MARKER_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
464 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
465 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
466 #if 0 |
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 static ExifTextList CanonCustomEnable[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
469 { 0, "off" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
470 { 1, "on" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
471 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
472 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
473 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
474 static ExifTextList CanonCustomEnableInvert[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
475 { 0, "on" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
476 { 1, "off" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
477 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
478 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
479 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
480 static ExifTextList CanonCustomExposureLevel[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
481 { 0, "1/2 stop" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
482 { 1, "1/3 stop" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
483 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
484 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
485 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
486 static ExifTextList CanonCustomAVShutterSpeed[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
487 { 0, "auto" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
488 { 1, "1/200 (fixed)" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
489 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
490 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
491 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
492 static ExifTextList CanonCustomShutterCurtainSync[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
493 { 0, "1st" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
494 { 1, "2nd" }, |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
495 EXIF_TEXT_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
496 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
497 |
51
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
50
diff
changeset
|
498 static ExifMarker CanonCustom[] = { |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
50
diff
changeset
|
499 { 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
|
500 /*{ 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
|
501 "Shutter/Auto exposure button function",CanonCustomBTNShutter }, */ |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
50
diff
changeset
|
502 { 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
|
503 { 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
|
504 "Tv/Av and exposure level", CanonCustomExposureLevel }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
50
diff
changeset
|
505 { 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
|
506 { 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
|
507 "Shutter speed in Av mode", CanonCustomAVShutterSpeed }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
50
diff
changeset
|
508 /*{ 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
|
509 "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
|
510 { 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
|
511 /* { 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
|
512 { 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
|
513 "Fill flash auto reduction", CanonCustomEnableInvert }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
50
diff
changeset
|
514 /*{ 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
|
515 "Menu button function", CanonCustom }, */ |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
50
diff
changeset
|
516 /*{ 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
|
517 { 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
|
518 EXIF_MARKER_LIST_END |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
519 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
520 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
521 #endif |
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 static ExifMarker CanonExifMarkersList[] = { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
524 { 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
|
525 { 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
|
526 { 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
|
527 { 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
|
528 { 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
|
529 { 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
|
530 { 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
|
531 { 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
|
532 EXIF_MARKER_LIST_END |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
533 }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
534 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
535 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
|
536 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
|
537 ExifMarker *list) |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
538 { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
539 gint i; |
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 i = 0; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
542 while (list[i].tag != 0) |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
543 { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
544 if (list[i].tag < len) |
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 ExifItem *item; |
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 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
|
549 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
|
550 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
|
551 } |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
552 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
553 i++; |
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 } |
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 #if 0 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
558 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
|
559 { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
560 gint value; |
48
6948407f52a5
Fri Jun 3 18:43:46 2005 John Ellis <johne@verizon.net>
gqview
parents:
47
diff
changeset
|
561 ExifItem *result; |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
562 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
563 /* 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
|
564 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
|
565 { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
566 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
|
567 "SubjectDistance", "Subject distance", NULL }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
568 ExifItem *item; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
569 ExifRational *rational; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
570 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
571 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
|
572 rational = item->data; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
573 rational->num = value; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
574 rational->den = 100; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
575 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
576 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
|
577 } |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
578 |
48
6948407f52a5
Fri Jun 3 18:43:46 2005 John Ellis <johne@verizon.net>
gqview
parents:
47
diff
changeset
|
579 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
|
580 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
|
581 { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
582 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
|
583 "SerialNumber", "Camera serial number", NULL }; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
584 ExifItem *item; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
585 gchar *text; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
586 gint l; |
48
6948407f52a5
Fri Jun 3 18:43:46 2005 John Ellis <johne@verizon.net>
gqview
parents:
47
diff
changeset
|
587 guint32 n; |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
588 |
49
ae627d150a6b
Fri Jun 3 20:02:23 2005 John Ellis <johne@verizon.net>
gqview
parents:
48
diff
changeset
|
589 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
|
590 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
|
591 l = strlen(text) + 1; |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
592 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
|
593 memcpy(item->data, text, l); |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
594 g_free(text); |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
595 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
596 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
|
597 } |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
598 } |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
599 #endif |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
600 |
51
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
50
diff
changeset
|
601 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
|
602 guint size, ExifByteOrder bo) |
47
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
603 { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
604 ExifItem *item; |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
605 |
54
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
606 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
|
607 { |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
608 return FALSE; |
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 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
611 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
|
612 if (item) |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
613 { |
54
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
614 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
|
615 } |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
616 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
617 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
|
618 if (item) |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
619 { |
54
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
620 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
|
621 } |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
622 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
623 #if 0 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
624 canon_mknote_parse_convert(exif); |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
625 #endif |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
626 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
627 return TRUE; |
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 |
aa4c0e1b54b0
Fri Jun 3 01:49:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
630 |