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