diff options
author | Ton Roosendaal <ton@blender.org> | 2006-06-29 16:55:28 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2006-06-29 16:55:28 +0400 |
commit | 0735bf0ae144b6cad1470c4e3d94bf4b4e10b13f (patch) | |
tree | a4d0c8fb0fc147c18025083fb79f5cde09113256 /source/blender/src/header_image.c | |
parent | 5eefa4982bd78f3b58f0e1953fa381603ce62710 (diff) |
Bugfix, own collection while testing:
- When saving image from Image Window, the extension was not added (with
the option 'add extensions' set, in Scene buttons output panel)
- Same situation, after a save the data-block Image name was still the old
one, also on 'reload' (in header and browsing menus). Confusing... so
when saving image under new name now also renames the Image block.
Diffstat (limited to 'source/blender/src/header_image.c')
-rw-r--r-- | source/blender/src/header_image.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/src/header_image.c b/source/blender/src/header_image.c index ede2b6d51d6..832dab67845 100644 --- a/source/blender/src/header_image.c +++ b/source/blender/src/header_image.c @@ -176,14 +176,18 @@ static void replace_space_image(char *str) /* called from fileselect */ static void save_paint(char *name) { - char str[FILE_MAXDIR+FILE_MAXFILE]; Image *ima = G.sima->image; + int len; + char str[FILE_MAXDIR+FILE_MAXFILE]; if (ima && ima->ibuf) { BLI_strncpy(str, name, sizeof(str)); BLI_convertstringcode(str, G.sce, G.scene->r.cfra); + if(G.scene->r.scemode & R_EXTENSION) + BKE_add_image_extension(str, G.scene->r.imtype); + if (saveover(str)) { waitcursor(1); if (BKE_write_ibuf(ima->ibuf, str, G.scene->r.imtype, G.scene->r.subimtype, G.scene->r.quality)) { @@ -194,6 +198,12 @@ static void save_paint(char *name) } else { error("Couldn't write image: %s", str); } + + /* name image as how we saved it */ + len= strlen(str); + while (len > 0 && str[len - 1] != '/' && str[len - 1] != '\\') len--; + rename_id(&ima->id, str+len); + waitcursor(0); } } @@ -334,6 +344,7 @@ void do_image_buttons(unsigned short event) char str[64]; save_image_filesel_str(str); + /* so it shows extension in file window */ if(G.scene->r.scemode & R_EXTENSION) BKE_add_image_extension(name, G.scene->r.imtype); @@ -726,6 +737,7 @@ static void do_image_imagemenu(void *arg, int event) char str[64]; save_image_filesel_str(str); + /* so it shows an extension in filewindow */ if(G.scene->r.scemode & R_EXTENSION) BKE_add_image_extension(name, G.scene->r.imtype); |