diff options
author | Kent Mein <mein@cs.umn.edu> | 2005-11-22 21:50:03 +0300 |
---|---|---|
committer | Kent Mein <mein@cs.umn.edu> | 2005-11-22 21:50:03 +0300 |
commit | 00f266c651a52027b662f725d081af6b51aae343 (patch) | |
tree | 40fd6d4d9a76f1eddcc63e5af6091c1442922dca /source/blender/imbuf/intern/util.c | |
parent | b63e26e109ba8c651ea20f553e3ca8e0604fc73f (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/imbuf/intern/util.c')
-rw-r--r-- | source/blender/imbuf/intern/util.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c index bbfa41e9dcc..4cdfa852df1 100644 --- a/source/blender/imbuf/intern/util.c +++ b/source/blender/imbuf/intern/util.c @@ -45,6 +45,7 @@ #include "IMB_targa.h" #include "IMB_png.h" #include "IMB_bmp.h" +#include "IMB_tiff.h" #include "IMB_radiance_hdr.h" #include "IMB_anim.h" @@ -97,6 +98,8 @@ static int IMB_ispic_name(char *name) if (imb_is_a_png(buf)) return(PNG); if (imb_is_a_targa(buf)) return(TGA); + if (imb_is_a_tiff(buf)) return(TIF); + /* radhdr: check if hdr format */ if (imb_is_a_hdr(buf)) return(RADHDR); @@ -125,9 +128,15 @@ static int IMB_ispic_name(char *name) int IMB_ispic(char *filename) { if(U.uiflag & USER_FILTERFILEEXTS) { + if (G.have_libtiff && (BLI_testextensie(filename, ".tif") + || BLI_testextensie(filename, ".tiff"))) { + return IMB_ispic_name(filename); + } if (G.have_quicktime){ if( BLI_testextensie(filename, ".jpg") || BLI_testextensie(filename, ".jpeg") + || BLI_testextensie(filename, ".tif") + || BLI_testextensie(filename, ".tiff") || BLI_testextensie(filename, ".hdr") || BLI_testextensie(filename, ".tga") || BLI_testextensie(filename, ".rgb") @@ -137,8 +146,6 @@ int IMB_ispic(char *filename) || BLI_testextensie(filename, ".lbm") || BLI_testextensie(filename, ".gif") || BLI_testextensie(filename, ".psd") - || BLI_testextensie(filename, ".tif") - || BLI_testextensie(filename, ".tiff") || BLI_testextensie(filename, ".pct") || BLI_testextensie(filename, ".pict") || BLI_testextensie(filename, ".pntg") //macpaint @@ -148,7 +155,7 @@ int IMB_ispic(char *filename) } else { return(FALSE); } - } else { // no quicktime + } else { /* no quicktime or libtiff */ if( BLI_testextensie(filename, ".jpg") || BLI_testextensie(filename, ".jpeg") || BLI_testextensie(filename, ".hdr") @@ -165,7 +172,7 @@ int IMB_ispic(char *filename) return(FALSE); } } - } else { // no FILTERFILEEXTS + } else { /* no FILTERFILEEXTS */ return IMB_ispic_name(filename); } } |