Add option to GUI to load rendered images from different prefix
[colorize.git] / gui / image.c
index bd5804c..6a971ef 100644 (file)
@@ -101,10 +101,14 @@ void create_rendered(const char *filename)
 
        p = filename;
        while((q = strchr(p, DIR_SEPERATOR)))
-       p = q + 1;
-       strcpy(imgfile, filename);
-       imgfile[p - filename] = '\0';
-       strcat(imgfile, "colorized_");
+               p = q + 1;
+       if (output_prefix[0] == '\0') {
+               strcpy(imgfile, filename);
+               imgfile[p - filename] = '\0';
+               strcat(imgfile, "colorized_");
+       } else {
+               strcpy(imgfile, output_prefix);
+       }
        strcat(imgfile, p);
 
        img_preview_buffer = load_img(&width, &height, imgfile, 0);