Mercurial > geeqie.yaz
annotate src/format_fuji.c @ 793:baade53888be
used new notification in cache_maint
author | nadvornik |
---|---|
date | Fri, 06 Jun 2008 22:34:15 +0000 |
parents | 116346636d42 |
children | 4fe8f9656107 |
rev | line source |
---|---|
45 | 1 /* |
541 | 2 * Geeqie |
3 * (C) 2005 John Ellis | |
475 | 4 * Copyright (C) 2008 The Geeqie Team |
45 | 5 * |
6 * Authors: | |
7 * Original version 2005 Lars Ellenberg, base on dcraw by David coffin. | |
8 * | |
9 * This software is released under the GNU General Public License (GNU GPL). | |
10 * Please read the included file COPYING for more information. | |
11 * This software comes with no warranty of any kind, use at your own risk! | |
12 */ | |
13 | |
14 #ifdef HAVE_CONFIG_H | |
15 # include "config.h" | |
16 #endif | |
17 | |
177 | 18 #ifndef HAVE_EXIV2 |
45 | 19 |
20 #include <stdio.h> | |
21 #include <string.h> | |
22 #include <unistd.h> | |
23 | |
24 #include <glib.h> | |
25 | |
26 #include "intl.h" | |
27 | |
281 | 28 #include "main.h" |
45 | 29 #include "format_fuji.h" |
30 #include "format_raw.h" | |
31 | |
51
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
32 #include "exif.h" |
45 | 33 |
51
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
34 |
53
00843150f7c8
Tue Jun 7 03:47:03 2005 John Ellis <johne@verizon.net>
gqview
parents:
51
diff
changeset
|
35 /* |
00843150f7c8
Tue Jun 7 03:47:03 2005 John Ellis <johne@verizon.net>
gqview
parents:
51
diff
changeset
|
36 *----------------------------------------------------------------------------- |
00843150f7c8
Tue Jun 7 03:47:03 2005 John Ellis <johne@verizon.net>
gqview
parents:
51
diff
changeset
|
37 * Raw (RAF) embedded jpeg extraction for Fujifilm |
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 */ |
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 |
54
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
42 gint format_fuji_raw(unsigned char *data, const guint len, |
51
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
43 guint *image_offset, guint *exif_offset) |
45 | 44 { |
45 guint io; | |
46 guint eo; | |
47 | |
48 if (len < 128 || | |
49 memcmp(data, "FUJIFILM", 8) != 0) | |
50 { | |
51 return FALSE; | |
52 } | |
53 | |
101
847e4bc6b54c
Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
54 /* offset to jpeg is embedded at bytes 84-87 */ |
108
9c355d5c8619
Fri Nov 10 16:11:28 2006 John Ellis <johne@verizon.net>
gqview
parents:
101
diff
changeset
|
55 io = exif_byte_get_int32(data + 84, EXIF_BYTE_ORDER_MOTOROLA); |
101
847e4bc6b54c
Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
56 if (io + 4 > len) return FALSE; |
45 | 57 |
58 /* verify jpeg marker */ | |
59 if (memcmp(data + io, "\xff\xd8\xff\xe1", 4) != 0) | |
60 { | |
61 return FALSE; | |
62 } | |
63 | |
101
847e4bc6b54c
Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
64 /* Exif is stored in the jpeg, so use the same offset */ |
847e4bc6b54c
Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
65 eo=io; |
847e4bc6b54c
Tue Nov 7 15:35:59 2006 John Ellis <johne@verizon.net>
gqview
parents:
57
diff
changeset
|
66 |
45 | 67 if (image_offset) *image_offset = io; |
68 if (exif_offset) *exif_offset = eo; | |
69 | |
70 return TRUE; | |
71 } | |
72 | |
73 | |
51
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
74 /* |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
75 *----------------------------------------------------------------------------- |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
76 * EXIF Makernote for Fujifilm |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
77 *----------------------------------------------------------------------------- |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
78 */ |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
79 |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
80 static ExifTextList FujiTagSharpness[] = { |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
81 { 1, "soft" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
82 { 2, "soft" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
83 { 3, "normal" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
84 { 4, "hard" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
85 { 5, "hard" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
86 EXIF_TEXT_LIST_END |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
87 }; |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
88 |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
89 static ExifTextList FujiTagWhiteBalance[]= { |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
90 { 0, "auto" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
91 { 256, "daylight" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
92 { 512, "cloudy" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
93 { 768, "daylight color-fluorescence" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
94 { 769, "daywhite color-fluorescence" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
95 { 770, "white-fluorescence" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
96 { 1024, "incandescent" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
97 { 3840, "custom" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
98 EXIF_TEXT_LIST_END |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
99 }; |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
100 |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
101 static ExifTextList FujiTagColorTone[]= { |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
102 { 0, "normal" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
103 { 256, "high" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
104 { 512, "low" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
105 EXIF_TEXT_LIST_END |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
106 }; |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
107 |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
108 static ExifTextList FujiTagFlashMode[]= { |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
109 { 0, "auto" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
110 { 1, "on" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
111 { 2, "off" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
112 { 3, "red-eye reduction" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
113 EXIF_TEXT_LIST_END |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
114 }; |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
115 |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
116 static ExifTextList FujiTagOffOn[]= { |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
117 { 0, "off" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
118 { 1, "on" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
119 EXIF_TEXT_LIST_END |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
120 }; |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
121 |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
122 static ExifTextList FujiTagFocusMode[]= { |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
123 { 0, "auto" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
124 { 1, "manual" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
125 EXIF_TEXT_LIST_END |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
126 }; |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
127 |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
128 static ExifTextList FujiTagPictureMode[]= { |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
129 { 0, "auto" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
130 { 1, "portrait" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
131 { 2, "landscape" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
132 { 4, "sports" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
133 { 5, "night" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
134 { 6, "program AE" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
135 { 256, "aperture priority AE" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
136 { 512, "shutter priority AE" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
137 { 768, "manual" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
138 EXIF_TEXT_LIST_END |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
139 }; |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
140 |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
141 static ExifTextList FujiTagNoYes[]= { |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
142 { 0, "no" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
143 { 1, "yes" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
144 EXIF_TEXT_LIST_END |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
145 }; |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
146 |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
147 #if 0 |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
148 static ExifTextList FujiTag[]= { |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
149 { , "" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
150 { , "" }, |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
151 EXIF_TEXT_LIST_END |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
152 }; |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
153 #endif |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
154 |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
155 |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
156 static ExifMarker FujiExifMarkersList[] = { |
57
a8c9992320f4
Fri Jun 10 20:57:42 2005 John Ellis <johne@verizon.net>
gqview
parents:
54
diff
changeset
|
157 { 0x1000, EXIF_FORMAT_STRING, 8, "Fuji.Quality", "Quality", NULL }, |
a8c9992320f4
Fri Jun 10 20:57:42 2005 John Ellis <johne@verizon.net>
gqview
parents:
54
diff
changeset
|
158 { 0x1001, EXIF_FORMAT_SHORT_UNSIGNED, 1, "Fuji.Sharpness", "Sharpness", FujiTagSharpness }, |
a8c9992320f4
Fri Jun 10 20:57:42 2005 John Ellis <johne@verizon.net>
gqview
parents:
54
diff
changeset
|
159 { 0x1002, EXIF_FORMAT_SHORT_UNSIGNED, 1, "Fuji.WhiteBalance", "White balance",FujiTagWhiteBalance }, |
a8c9992320f4
Fri Jun 10 20:57:42 2005 John Ellis <johne@verizon.net>
gqview
parents:
54
diff
changeset
|
160 { 0x1003, EXIF_FORMAT_SHORT_UNSIGNED, 1, "Fuji.Color", "Color", FujiTagColorTone }, |
a8c9992320f4
Fri Jun 10 20:57:42 2005 John Ellis <johne@verizon.net>
gqview
parents:
54
diff
changeset
|
161 { 0x1004, EXIF_FORMAT_SHORT_UNSIGNED, 1, "Fuji.Tone", "Tone", FujiTagColorTone }, |
a8c9992320f4
Fri Jun 10 20:57:42 2005 John Ellis <johne@verizon.net>
gqview
parents:
54
diff
changeset
|
162 { 0x1010, EXIF_FORMAT_SHORT_UNSIGNED, 1, "Fuji.FlashMode", "Flash mode", FujiTagFlashMode }, |
a8c9992320f4
Fri Jun 10 20:57:42 2005 John Ellis <johne@verizon.net>
gqview
parents:
54
diff
changeset
|
163 { 0x1011, EXIF_FORMAT_RATIONAL, 1, "Fuji.FlashStrength", "Flash strength", NULL }, |
a8c9992320f4
Fri Jun 10 20:57:42 2005 John Ellis <johne@verizon.net>
gqview
parents:
54
diff
changeset
|
164 { 0x1020, EXIF_FORMAT_SHORT_UNSIGNED, 1, "Fuji.Macro", "Macro", FujiTagOffOn }, |
a8c9992320f4
Fri Jun 10 20:57:42 2005 John Ellis <johne@verizon.net>
gqview
parents:
54
diff
changeset
|
165 { 0x1021, EXIF_FORMAT_SHORT_UNSIGNED, 1, "Fuji.FocusMode", "Focus mode", FujiTagFocusMode }, |
a8c9992320f4
Fri Jun 10 20:57:42 2005 John Ellis <johne@verizon.net>
gqview
parents:
54
diff
changeset
|
166 { 0x1030, EXIF_FORMAT_SHORT_UNSIGNED, 1, "Fuji.SlowSync", "Slow synchro", FujiTagOffOn }, |
a8c9992320f4
Fri Jun 10 20:57:42 2005 John Ellis <johne@verizon.net>
gqview
parents:
54
diff
changeset
|
167 { 0x1031, EXIF_FORMAT_SHORT_UNSIGNED, 1, "Fuji.PictureMode", "Picture mode", FujiTagPictureMode }, |
a8c9992320f4
Fri Jun 10 20:57:42 2005 John Ellis <johne@verizon.net>
gqview
parents:
54
diff
changeset
|
168 { 0x1100, EXIF_FORMAT_SHORT_UNSIGNED, 1, "Fuji.ContTake/Bracket", |
51
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
169 "Continuous / Auto bracket", FujiTagOffOn }, |
57
a8c9992320f4
Fri Jun 10 20:57:42 2005 John Ellis <johne@verizon.net>
gqview
parents:
54
diff
changeset
|
170 { 0x1300, EXIF_FORMAT_SHORT_UNSIGNED, 1, "Fuji.BlurWarning", "Blue warning", FujiTagNoYes }, |
a8c9992320f4
Fri Jun 10 20:57:42 2005 John Ellis <johne@verizon.net>
gqview
parents:
54
diff
changeset
|
171 { 0x1301, EXIF_FORMAT_SHORT_UNSIGNED, 1, "Fuji.FocusWarning", "Focus warning",FujiTagNoYes }, |
a8c9992320f4
Fri Jun 10 20:57:42 2005 John Ellis <johne@verizon.net>
gqview
parents:
54
diff
changeset
|
172 { 0x1302, EXIF_FORMAT_SHORT_UNSIGNED, 1, "Fuji.AEWarning", "AE warning", FujiTagNoYes }, |
51
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
173 EXIF_MARKER_LIST_END |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
174 }; |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
175 |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
176 |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
177 |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
178 gint format_fuji_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
|
179 guint size, ExifByteOrder bo) |
51
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
180 { |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
181 unsigned char *data; |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
182 guint ifdstart; |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
183 |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
184 if (offset + 8 + 4 >= size) return FALSE; |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
185 |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
186 data = tiff + offset; |
54
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
187 |
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
188 /* Fuji tag format starts with "FUJIFILM", |
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
189 * followed by 4 bytes indicating offset to IFD directory using Fuji tags, |
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
190 * byte order is always little endian (II). |
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
191 */ |
51
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
192 if (memcmp(data, "FUJIFILM", 8) != 0) return FALSE; |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
193 |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
194 ifdstart = exif_byte_get_int32(data + 8, EXIF_BYTE_ORDER_INTEL); |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
195 if (offset + ifdstart >= size) return FALSE; |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
196 |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
197 if (exif_parse_IFD_table(exif, tiff + offset, ifdstart, size - offset, |
54
b58cac75ad12
Thu Jun 9 22:23:18 2005 John Ellis <johne@verizon.net>
gqview
parents:
53
diff
changeset
|
198 EXIF_BYTE_ORDER_INTEL, 0, FujiExifMarkersList) != 0) |
51
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
199 { |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
200 return FALSE; |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
201 } |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
202 |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
203 return TRUE; |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
204 } |
276ea4c98d33
Sat Jun 4 22:24:00 2005 John Ellis <johne@verizon.net>
gqview
parents:
45
diff
changeset
|
205 |
442 | 206 #endif |
177 | 207 /* not HAVE_EXIV2 */ |