Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenkernel/intern/image.c')
-rw-r--r--source/blender/blenkernel/intern/image.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 8a15f63243c..c44634fed34 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -26,6 +26,11 @@
* ***** END GPL LICENSE BLOCK *****
*/
+/** \file blender/blenkernel/intern/image.c
+ * \ingroup bke
+ */
+
+
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
@@ -845,9 +850,15 @@ int BKE_add_image_extension(char *string, int imtype)
if(extension) {
/* prefer this in many cases to avoid .png.tga, but in certain cases it breaks */
- /* return BLI_replace_extension(string, FILE_MAX, extension); */
- strcat(string, extension);
- return TRUE;
+ /* remove any other known image extension */
+ if(BLI_testextensie_array(string, imb_ext_image)
+ || (G.have_quicktime && BLI_testextensie_array(string, imb_ext_image_qt))) {
+ return BLI_replace_extension(string, FILE_MAX, extension);
+ } else {
+ strcat(string, extension);
+ return TRUE;
+ }
+
}
else {
return FALSE;
@@ -1238,8 +1249,8 @@ int BKE_write_ibuf(Scene *scene, ImBuf *ibuf, const char *name, int imtype, int
int ok;
(void)subimtype; /* quies unused warnings */
- if(imtype==0) {
- /* pass */
+ if(imtype == -1) {
+ /* use whatever existing image type is set by 'ibuf' */
}
else if(imtype== R_IRIS) {
ibuf->ftype= IMAGIC;