diff options
author | Ton Roosendaal <ton@blender.org> | 2006-07-03 15:21:38 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2006-07-03 15:21:38 +0400 |
commit | 780b8d83c5587caa6c6d73da4411e55cf69757d0 (patch) | |
tree | 641d9a62d7060547d79fdf653edc8747567bc637 /source | |
parent | 10d6a50ae0ee3b9ee1fb727d1980b6fb151baec1 (diff) |
Bugfix #4578
Images saved with "Save..." menu in Image Window ignored the RGB or RGBA
setting in Scene Output panel.
Also:
- changed menu in "Save As..." to indicate it can change type/name
- added proper info about image in properties panel (RGB, A, Z)
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/src/drawimage.c | 21 | ||||
-rw-r--r-- | source/blender/src/header_image.c | 9 |
2 files changed, 24 insertions, 6 deletions
diff --git a/source/blender/src/drawimage.c b/source/blender/src/drawimage.c index dcf880df300..b5a4ceb8373 100644 --- a/source/blender/src/drawimage.c +++ b/source/blender/src/drawimage.c @@ -921,13 +921,24 @@ static void image_panel_properties(short cntrl) // IMAGE_HANDLER_PROPERTIES return; if (G.sima->image && G.sima->image->ibuf) { + ImBuf *ibuf= G.sima->image->ibuf; char str[64]; - sprintf(str, "Image: size %d x %d", G.sima->image->ibuf->x, G.sima->image->ibuf->y); - if(G.sima->image->ibuf->rect_float) - strcat(str, " 4x32 bits"); - else - strcat(str, " 4x8 bits"); + sprintf(str, "Image: size %d x %d", ibuf->x, ibuf->y); + if(ibuf->rect_float) { + if(ibuf->depth==32) + strcat(str, " RGBA float"); + else + strcat(str, " RGB float"); + } + else { + if(ibuf->depth==32) + strcat(str, " RGBA byte"); + else + strcat(str, " RGB byte"); + } + if(ibuf->zbuf || ibuf->zbuf_float) + strcat(str, " + Z"); uiDefBut(block, LABEL, B_NOP, str, 10,180,300,19, 0, 0, 0, 0, 0, ""); diff --git a/source/blender/src/header_image.c b/source/blender/src/header_image.c index c28875f7525..4d87f3c9c56 100644 --- a/source/blender/src/header_image.c +++ b/source/blender/src/header_image.c @@ -189,6 +189,13 @@ static void save_paint(char *name) BKE_add_image_extension(str, G.scene->r.imtype); if (saveover(str)) { + + /* enforce user setting for RGB or RGBA, but skip BW */ + if(G.scene->r.planes==32) + ima->ibuf->depth= 32; + else if(G.scene->r.planes==24) + ima->ibuf->depth= 24; + waitcursor(1); if (BKE_write_ibuf(ima->ibuf, str, G.scene->r.imtype, G.scene->r.subimtype, G.scene->r.quality)) { BLI_strncpy(ima->name, name, sizeof(ima->name)); @@ -812,7 +819,7 @@ static uiBlock *image_imagemenu(void *arg_unused) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Open...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); if (G.sima->image) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save As...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Replace...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reload", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); |