comparison src/format_raw.c @ 1453:bc3f5c0432f6

gint -> gboolean where applicable. The end (ouf!).
author zas_
date Mon, 16 Mar 2009 20:39:09 +0000
parents a3d3208b0c50
children 956aab097ea7
comparison
equal deleted inserted replaced
1452:67b40740122e 1453:bc3f5c0432f6
131 } 131 }
132 132
133 return exif_byte_get_int32(data + offset + count * 12, bo); 133 return exif_byte_get_int32(data + offset + count * 12, bo);
134 } 134 }
135 135
136 static gint format_tiff_find_tag_data(guchar *data, const guint len, 136 static gboolean format_tiff_find_tag_data(guchar *data, const guint len,
137 guint tag, ExifFormatType type, 137 guint tag, ExifFormatType type,
138 guint *result_offset, guint *result_count) 138 guint *result_offset, guint *result_count)
139 { 139 {
140 ExifByteOrder bo; 140 ExifByteOrder bo;
141 guint offset; 141 guint offset;
142 142
143 if (len < 8) return FALSE; 143 if (len < 8) return FALSE;
180 } 180 }
181 181
182 static FormatRawEntry *format_raw_find(guchar *data, const guint len) 182 static FormatRawEntry *format_raw_find(guchar *data, const guint len)
183 { 183 {
184 gint n; 184 gint n;
185 gint tiff; 185 gboolean tiff;
186 guint make_count = 0; 186 guint make_count = 0;
187 guint make_offset = 0; 187 guint make_offset = 0;
188 188
189 tiff = (len > 8 && 189 tiff = (len > 8 &&
190 (memcmp(data, "II\x2a\x00", 4) == 0 || 190 (memcmp(data, "II\x2a\x00", 4) == 0 ||
228 } 228 }
229 229
230 return NULL; 230 return NULL;
231 } 231 }
232 232
233 static gint format_raw_parse(FormatRawEntry *entry, 233 static gboolean format_raw_parse(FormatRawEntry *entry,
234 guchar *data, const guint len, 234 guchar *data, const guint len,
235 guint *image_offset, guint *exif_offset) 235 guint *image_offset, guint *exif_offset)
236 { 236 {
237 guint io = 0; 237 guint io = 0;
238 guint eo = 0; 238 guint eo = 0;
239 gint found; 239 gboolean found;
240 240
241 if (!entry || !entry->func_parse) return FALSE; 241 if (!entry || !entry->func_parse) return FALSE;
242 242
243 DEBUG_1("RAW using file parser for %s", entry->description); 243 DEBUG_1("RAW using file parser for %s", entry->description);
244 244
255 if (exif_offset) *exif_offset = eo; 255 if (exif_offset) *exif_offset = eo;
256 256
257 return TRUE; 257 return TRUE;
258 } 258 }
259 259
260 gint format_raw_img_exif_offsets(guchar *data, const guint len, 260 gboolean format_raw_img_exif_offsets(guchar *data, const guint len,
261 guint *image_offset, guint *exif_offset) 261 guint *image_offset, guint *exif_offset)
262 { 262 {
263 FormatRawEntry *entry; 263 FormatRawEntry *entry;
264 264
265 if (!data || len < 1) return FALSE; 265 if (!data || len < 1) return FALSE;
266 266
292 292
293 return entry->exif_type; 293 return entry->exif_type;
294 } 294 }
295 295
296 296
297 gint format_raw_img_exif_offsets_fd(gint fd, const gchar *path, 297 gboolean format_raw_img_exif_offsets_fd(gint fd, const gchar *path,
298 guchar *header_data, const guint header_len, 298 guchar *header_data, const guint header_len,
299 guint *image_offset, guint *exif_offset) 299 guint *image_offset, guint *exif_offset)
300 { 300 {
301 FormatRawEntry *entry; 301 FormatRawEntry *entry;
302 gpointer map_data = NULL; 302 gpointer map_data = NULL;
303 size_t map_len = 0; 303 size_t map_len = 0;
304 struct stat st; 304 struct stat st;
305 gint success; 305 gboolean success;
306 306
307 if (!header_data || fd < 0) return FALSE; 307 if (!header_data || fd < 0) return FALSE;
308 308
309 /* given image pathname, first do simple (and fast) file extension test */ 309 /* given image pathname, first do simple (and fast) file extension test */
310 if (path) 310 if (path)
412 } 412 }
413 413
414 return FALSE; 414 return FALSE;
415 } 415 }
416 416
417 gint format_exif_makernote_parse(ExifData *exif, guchar *tiff, guint offset, 417 gboolean format_exif_makernote_parse(ExifData *exif, guchar *tiff, guint offset,
418 guint size, ExifByteOrder bo) 418 guint size, ExifByteOrder bo)
419 { 419 {
420 FormatExifEntry *entry; 420 FormatExifEntry *entry;
421 421
422 entry = format_exif_makernote_find(exif, tiff, offset, size); 422 entry = format_exif_makernote_find(exif, tiff, offset, size);
423 423
521 log_printf("%*s----------- end of #%d ------------\n", level, "", level); 521 log_printf("%*s----------- end of #%d ------------\n", level, "", level);
522 522
523 return exif_byte_get_int32(data + offset + count * EXIF_TIFD_SIZE, bo); 523 return exif_byte_get_int32(data + offset + count * EXIF_TIFD_SIZE, bo);
524 } 524 }
525 525
526 gint format_debug_tiff_raw(guchar *data, const guint len, 526 gboolean format_debug_tiff_raw(guchar *data, const guint len,
527 guint *image_offset, guint *exif_offset) 527 guint *image_offset, guint *exif_offset)
528 { 528 {
529 ExifByteOrder bo; 529 ExifByteOrder bo;
530 gint level; 530 gint level;
531 guint offset; 531 guint offset;
532 532