Fix #20146:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Sat, 30 Jan 2010 09:14:12 +0000 (09:14 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Sat, 30 Jan 2010 09:14:12 +0000 (09:14 +0000)
* .tif not loading on newer linux distributions, wasn't looking for
  libtiff version 4.
* fix dds being too verbose when testing if it can open an image file.

source/blender/imbuf/intern/dds/dds_api.cpp
source/blender/imbuf/intern/dynlibtiff.c
source/blender/imbuf/intern/gen_dynlibtiff.py

index d7ff47616056552505815a8c5d0649a3382d8a29..20b77c7584137808d8891870686f86d4e8a0188c 100644 (file)
@@ -80,6 +80,10 @@ struct ImBuf *imb_load_dds(unsigned char *mem, int size, int flags)
 
        /* check if DDS is valid and supported */
        if (!dds.isValid()) {
+               /* no need to print error here, just testing if it is a DDS */
+               if(flags & IB_test)
+                       return (0);
+
                printf("DDS: not valid; header follows\n");
                dds.printInfo();
                return(0);
index 6db83b37c053ac2e0f06eaac53a8b5e581134676..18d508b6db4d2430957eb5535fcc08b57a61edef 100644 (file)
@@ -85,40 +85,58 @@ void libtiff_loadlibtiff(void)
        if (libtiff != NULL)  return;
        libtiff = PIL_dynlib_open("/usr/local/lib/libtiff.3.dylib");
        if (libtiff != NULL)  return;
+       libtiff = PIL_dynlib_open("/usr/local/lib/libtiff.4.dylib");
+       if (libtiff != NULL)  return;
        //inside the blender app package contents/resources
        libtiff = PIL_dynlib_open("@executable_path/../resources/libtiff.dylib");
        if (libtiff != NULL)  return;
        libtiff = PIL_dynlib_open("@executable_path/../resources/libtiff.3.dylib");
        if (libtiff != NULL)  return;
+       libtiff = PIL_dynlib_open("@executable_path/../resources/libtiff.4.dylib");
+       if (libtiff != NULL)  return;
        //inside the blender app package contents/frameworks
        libtiff = PIL_dynlib_open("@executable_path/../frameworks/libtiff.dylib");
        if (libtiff != NULL)  return;
        libtiff = PIL_dynlib_open("@executable_path/../frameworks/libtiff.3.dylib");
        if (libtiff != NULL)  return;
+       libtiff = PIL_dynlib_open("@executable_path/../frameworks/libtiff.4.dylib");
+       if (libtiff != NULL)  return;
        //along side the blender app package
        libtiff = PIL_dynlib_open("@executable_path/../../../libtiff.dylib");
        if (libtiff != NULL)  return;
        libtiff = PIL_dynlib_open("@executable_path/../../../libtiff.3.dylib");
        if (libtiff != NULL)  return;
+       libtiff = PIL_dynlib_open("@executable_path/../../../libtiff.4.dylib");
+       if (libtiff != NULL)  return;
        //inside the blender app package contents/MacOS
        libtiff = PIL_dynlib_open("@executable_path/libtiff.dylib");
        if (libtiff != NULL)  return;
        libtiff = PIL_dynlib_open("@executable_path/libtiff.3.dylib");
        if (libtiff != NULL)  return;
+       libtiff = PIL_dynlib_open("@executable_path/libtiff.4.dylib");
+       if (libtiff != NULL)  return;
 #else
        libtiff = PIL_dynlib_open("libtiff.so");
        if (libtiff != NULL)  return;
        libtiff = PIL_dynlib_open("libtiff.so.3");
        if (libtiff != NULL)  return;
+       libtiff = PIL_dynlib_open("libtiff.so.4");
+       if (libtiff != NULL)  return;
        libtiff = PIL_dynlib_open("libtiff.dll");
        if (libtiff != NULL)  return;
        libtiff = PIL_dynlib_open("/usr/lib/libtiff.so");
        if (libtiff != NULL)  return;
        libtiff = PIL_dynlib_open("/usr/lib/libtiff.so.3");
        if (libtiff != NULL)  return;
+       libtiff = PIL_dynlib_open("/usr/lib/libtiff.so.4");
+       if (libtiff != NULL)  return;
 #ifdef __x86_64__
+       libtiff = PIL_dynlib_open("/usr/lib64/libtiff.so");
+       if (libtiff != NULL)  return;
        libtiff = PIL_dynlib_open("/usr/lib64/libtiff.so.3");
        if (libtiff != NULL)  return;
+       libtiff = PIL_dynlib_open("/usr/lib64/libtiff.so.4");
+       if (libtiff != NULL)  return;
 #endif
        libtiff = PIL_dynlib_open("/usr/local/lib/libtiff.so");
        if (libtiff != NULL)  return;
index 4dba5b13aa0e188d09d16dde3ae4529d8ec428f6..a81ef981357498d423b96102c274e2c2c7d82169 100755 (executable)
@@ -117,25 +117,71 @@ void libtiff_loadlibtiff(void)
        if (libtiff != NULL)  return;
 
        /* Try to find libtiff in a couple of standard places */
+#ifdef __APPLE__
+       /* OSX has version specific library */
+       //standard install location
+       libtiff = PIL_dynlib_open("/usr/local/lib/libtiff.dylib");
+       if (libtiff != NULL)  return;
+       libtiff = PIL_dynlib_open("/usr/local/lib/libtiff.3.dylib");
+       if (libtiff != NULL)  return;
+       libtiff = PIL_dynlib_open("/usr/local/lib/libtiff.4.dylib");
+       if (libtiff != NULL)  return;
+       //inside the blender app package contents/resources
+       libtiff = PIL_dynlib_open("@executable_path/../resources/libtiff.dylib");
+       if (libtiff != NULL)  return;
+       libtiff = PIL_dynlib_open("@executable_path/../resources/libtiff.3.dylib");
+       if (libtiff != NULL)  return;
+       libtiff = PIL_dynlib_open("@executable_path/../resources/libtiff.4.dylib");
+       if (libtiff != NULL)  return;
+       //inside the blender app package contents/frameworks
+       libtiff = PIL_dynlib_open("@executable_path/../frameworks/libtiff.dylib");
+       if (libtiff != NULL)  return;
+       libtiff = PIL_dynlib_open("@executable_path/../frameworks/libtiff.3.dylib");
+       if (libtiff != NULL)  return;
+       libtiff = PIL_dynlib_open("@executable_path/../frameworks/libtiff.4.dylib");
+       if (libtiff != NULL)  return;
+       //along side the blender app package
+       libtiff = PIL_dynlib_open("@executable_path/../../../libtiff.dylib");
+       if (libtiff != NULL)  return;
+       libtiff = PIL_dynlib_open("@executable_path/../../../libtiff.3.dylib");
+       if (libtiff != NULL)  return;
+       libtiff = PIL_dynlib_open("@executable_path/../../../libtiff.4.dylib");
+       if (libtiff != NULL)  return;
+       //inside the blender app package contents/MacOS
+       libtiff = PIL_dynlib_open("@executable_path/libtiff.dylib");
+       if (libtiff != NULL)  return;
+       libtiff = PIL_dynlib_open("@executable_path/libtiff.3.dylib");
+       if (libtiff != NULL)  return;
+       libtiff = PIL_dynlib_open("@executable_path/libtiff.4.dylib");
+       if (libtiff != NULL)  return;
+#else
        libtiff = PIL_dynlib_open("libtiff.so");
        if (libtiff != NULL)  return;
        libtiff = PIL_dynlib_open("libtiff.so.3");
        if (libtiff != NULL)  return;
+       libtiff = PIL_dynlib_open("libtiff.so.4");
+       if (libtiff != NULL)  return;
        libtiff = PIL_dynlib_open("libtiff.dll");
        if (libtiff != NULL)  return;
        libtiff = PIL_dynlib_open("/usr/lib/libtiff.so");
        if (libtiff != NULL)  return;
        libtiff = PIL_dynlib_open("/usr/lib/libtiff.so.3");
        if (libtiff != NULL)  return;
-       /* OSX has version specific library */
+       libtiff = PIL_dynlib_open("/usr/lib/libtiff.so.4");
+       if (libtiff != NULL)  return;
 #ifdef __x86_64__
+       libtiff = PIL_dynlib_open("/usr/lib64/libtiff.so");
+       if (libtiff != NULL)  return;
        libtiff = PIL_dynlib_open("/usr/lib64/libtiff.so.3");
        if (libtiff != NULL)  return;
+       libtiff = PIL_dynlib_open("/usr/lib64/libtiff.so.4");
+       if (libtiff != NULL)  return;
 #endif
        libtiff = PIL_dynlib_open("/usr/local/lib/libtiff.so");
        if (libtiff != NULL)  return;
        /* For solaris */
        libtiff = PIL_dynlib_open("/usr/openwin/lib/libtiff.so");
+#endif
 
 }
 
@@ -145,8 +191,11 @@ void *libtiff_findsymbol(char *name)
        assert(libtiff != NULL);
        symbol = PIL_dynlib_find_symbol(libtiff, name);
        if (symbol == NULL) {
-               printf("libtiff_findsymbol: error %s\\n",
-                       PIL_dynlib_get_error_as_string(libtiff));
+               char *err = PIL_dynlib_get_error_as_string(libtiff);
+
+               if (err) printf("libtiff_findsymbol: error %s\\n",err);
+               else printf("libtiff_findsymbol: error Unknown.\\n");
+
                libtiff = NULL;
                G.have_libtiff = (0);
                return NULL;