gchar**split=g_strsplit(filename,".",-1);// Split every time we see .
g_free(trimmed_file_name);
guintlen_of_extension_split=g_strv_length(split);
if(len_of_extension_split==2){// Only have two elements
trimmed_file_name=g_strdup(split[0]);// Get the first element
}else{
gchar*new_parsed_name="";
for(guinti=0;i<len_of_extension_split-1;i++){// Iterate over everything except the last item
if(g_strcmp0(new_parsed_name,"")==0){// Currently empty
new_parsed_name=g_strdup(split[i]);// Just duplicate this string
}else{
gchar*tmp_copy=g_strdup(new_parsed_name);
g_free(new_parsed_name);// Free the old
new_parsed_name=g_strdup(g_strjoin(".",tmp_copy,split[i],NULL));// Join the two strings with a . again and duplicate it, setting it to our new_parsed_name