diff options
-rw-r--r-- | parse-xml.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/parse-xml.c b/parse-xml.c index 22b11e7ea..1fad25bbb 100644 --- a/parse-xml.c +++ b/parse-xml.c @@ -1290,10 +1290,19 @@ static void event_end(void) { struct divecomputer *dc = get_dc(); if (cur_event.name) { - if (strcmp(cur_event.name, "surface") != 0) - add_event(dc, cur_event.time.seconds, - cur_event.type, cur_event.flags, - cur_event.value, cur_event.name); + if (strcmp(cur_event.name, "surface") != 0) { + /* 123 is a magic event that we used for a while to encode images in dives */ + if (cur_event.type == 123) { + struct picture *pic = alloc_picture(); + pic->filename = strdup(cur_event.name); + pic->offset = cur_event.time.seconds; + dive_add_picture(cur_dive, pic); + } else { + add_event(dc, cur_event.time.seconds, + cur_event.type, cur_event.flags, + cur_event.value, cur_event.name); + } + } free((void *)cur_event.name); } cur_event.active = 0; |