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);