+ if ( line_image ) {
+ // Ensure the filename is absolute
+ if ( g_path_is_absolute ( line_image ) )
+ vik_waypoint_set_image ( wp, line_image );
+ else {
+ // Otherwise create the absolute filename from the directory of the .vik file & and the relative filename
+ gchar *full = g_strconcat(dirpath, G_DIR_SEPARATOR_S, line_image, NULL);
+ gchar *absolute = file_realpath_dup ( full ); // resolved into the canonical name
+ vik_waypoint_set_image ( wp, absolute );
+ g_free ( absolute );
+ g_free ( full );
+ }
+ }