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:
authorKent Mein <mein@cs.umn.edu>2005-11-22 21:50:03 +0300
committerKent Mein <mein@cs.umn.edu>2005-11-22 21:50:03 +0300
commit00f266c651a52027b662f725d081af6b51aae343 (patch)
tree40fd6d4d9a76f1eddcc63e5af6091c1442922dca /source/blender/src
parentb63e26e109ba8c651ea20f553e3ca8e0604fc73f (diff)
This is a modified version of patch #2995
To enable dynamic tiff support. I had to fix some of the logic in the fileselect box for icons, I also expanded the patch to look in various default locations for a dynamic libtiff.so/libtiff.dll and look at the env variable BF_TIFF_LIB if it can't find it automatically. If unable to load the library it prints a message about setting BF_TIFF_LIB to the console. I haven't been able to test it on a lot of platforms but hopefully it will just work ;) I added the files to scons but have not had a chance to test that as well. Kent
Diffstat (limited to 'source/blender/src')
-rw-r--r--source/blender/src/buttons_scene.c7
-rw-r--r--source/blender/src/filesel.c8
-rw-r--r--source/blender/src/screendump.c6
-rw-r--r--source/blender/src/toets.c7
-rw-r--r--source/blender/src/usiblender.c6
-rw-r--r--source/blender/src/writeimage.c3
6 files changed, 25 insertions, 12 deletions
diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c
index 3739a8c2d98..ffa1390c8e0 100644
--- a/source/blender/src/buttons_scene.c
+++ b/source/blender/src/buttons_scene.c
@@ -919,6 +919,7 @@ static char *imagetype_pup(void)
{
static char string[1024];
char formatstring[1024];
+ char appendstring[1024];
strcpy(formatstring, "Save image as: %%t|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d");
@@ -986,6 +987,12 @@ static char *imagetype_pup(void)
);
}
+ if (G.have_libtiff) {
+ strcpy(formatstring, "|%s %%x%d");
+ sprintf(appendstring, formatstring, "TIFF", R_TIFF);
+ strcat(string, appendstring);
+ }
+
return (string);
}
diff --git a/source/blender/src/filesel.c b/source/blender/src/filesel.c
index 09cf0d8a42e..3b17f0c2c26 100644
--- a/source/blender/src/filesel.c
+++ b/source/blender/src/filesel.c
@@ -34,10 +34,6 @@
#include <string.h>
#include <math.h>
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#ifdef WIN32
#include <io.h>
#include <direct.h>
@@ -589,6 +585,10 @@ void test_flags_file(SpaceFile *sfile)
|| BLI_testextensie(file->relname, ".otf")
|| BLI_testextensie(file->relname, ".otc")) {
file->flags |= FTFONTFILE;
+ } else if (G.have_libtiff &&
+ (BLI_testextensie(file->relname, ".tif")
+ || BLI_testextensie(file->relname, ".tiff"))) {
+ file->flags |= IMAGEFILE;
} else if (G.have_quicktime){
if( BLI_testextensie(file->relname, ".jpg")
|| BLI_testextensie(file->relname, ".jpeg")
diff --git a/source/blender/src/screendump.c b/source/blender/src/screendump.c
index 4568eb7f4c5..ebc5bad88c6 100644
--- a/source/blender/src/screendump.c
+++ b/source/blender/src/screendump.c
@@ -33,10 +33,6 @@
#include <string.h>
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
@@ -89,6 +85,8 @@ void write_screendump(char *name)
else if(G.scene->r.imtype==R_TARGA) ibuf->ftype= TGA;
else if(G.scene->r.imtype==R_RAWTGA) ibuf->ftype= RAWTGA;
else if(G.scene->r.imtype==R_PNG) ibuf->ftype= PNG;
+ else if((G.have_libtiff) &&
+ (G.scene->r.imtype==R_TIFF)) ibuf->ftype= TIF;
else if(G.scene->r.imtype==R_HAMX) ibuf->ftype= AN_hamx;
else if(ELEM5(G.scene->r.imtype, R_MOVIE, R_AVICODEC, R_AVIRAW, R_AVIJPEG, R_JPEG90)) {
ibuf->ftype= JPG|G.scene->r.quality;
diff --git a/source/blender/src/toets.c b/source/blender/src/toets.c
index 721738b8931..0fee06a65d8 100644
--- a/source/blender/src/toets.c
+++ b/source/blender/src/toets.c
@@ -215,6 +215,9 @@ void schrijfplaatje(char *name)
else if(R.r.imtype==R_BMP) {
ibuf->ftype= BMP;
}
+ else if((G.have_libtiff) && (R.r.imtype==R_TIFF)) {
+ ibuf->ftype= TIF;
+ }
else if((R.r.imtype==R_TARGA) || (R.r.imtype==R_PNG)) {
ibuf->ftype= TGA;
}
@@ -491,6 +494,10 @@ int save_image_filesel_str(char *str)
strcpy(str, "Save PNG"); return 1;
case R_BMP:
strcpy(str, "Save BMP"); return 1;
+ case R_TIFF:
+ if (G.have_libtiff) {
+ strcpy(str, "Save TIFF"); return 1;
+ }
case R_TARGA:
strcpy(str, "Save Targa"); return 1;
case R_RAWTGA:
diff --git a/source/blender/src/usiblender.c b/source/blender/src/usiblender.c
index 25b46b064a9..a3dfbae7451 100644
--- a/source/blender/src/usiblender.c
+++ b/source/blender/src/usiblender.c
@@ -37,10 +37,6 @@
#include <stdio.h>
#include <string.h>
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#ifdef WIN32
#include "BLI_winstuff.h"
#include <process.h> /* getpid */
@@ -729,6 +725,8 @@ void exit_usiblender(void)
sound_exit_audio();
if(G.listener) MEM_freeN(G.listener);
+ libtiff_exit();
+
#ifdef WITH_QUICKTIME
quicktime_exit();
#endif
diff --git a/source/blender/src/writeimage.c b/source/blender/src/writeimage.c
index d7e0fd234ca..40160c42367 100644
--- a/source/blender/src/writeimage.c
+++ b/source/blender/src/writeimage.c
@@ -60,6 +60,9 @@ int BIF_write_ibuf(ImBuf *ibuf, char *name)
else if ((G.scene->r.imtype==R_BMP)) {
ibuf->ftype= BMP;
}
+ else if ((G.have_libtiff) && (G.scene->r.imtype==R_TIFF)) {
+ ibuf->ftype= TIF;
+ }
else if ((G.scene->r.imtype==R_TARGA) || (G.scene->r.imtype==R_PNG)) {
// fall back to Targa if PNG writing is not supported
ibuf->ftype= TGA;