[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [24237] trunk/blender/source: Mac / COCOA :

Damien Plisson damien.plisson at yahoo.fr
Mon Nov 2 12:20:31 CET 2009


Revision: 24237
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=24237
Author:   damien78
Date:     2009-11-02 12:20:31 +0100 (Mon, 02 Nov 2009)

Log Message:
-----------
Mac / COCOA : 
- revert tiff load/save to use standard libtiff (to ensure 100% colorimetry & alpha interpretation across platforms)
- include patch #18720 to fix load of libtiff dynlib (if present on system)

Modified Paths:
--------------
    trunk/blender/source/blender/imbuf/CMakeLists.txt
    trunk/blender/source/blender/imbuf/SConscript
    trunk/blender/source/blender/imbuf/intern/dynlibtiff.c
    trunk/blender/source/blender/imbuf/intern/readimage.c
    trunk/blender/source/blender/imbuf/intern/writeimage.c
    trunk/blender/source/blender/windowmanager/intern/wm_init_exit.c
    trunk/blender/source/creator/creator.c

Modified: trunk/blender/source/blender/imbuf/CMakeLists.txt
===================================================================
--- trunk/blender/source/blender/imbuf/CMakeLists.txt	2009-11-02 11:14:22 UTC (rev 24236)
+++ trunk/blender/source/blender/imbuf/CMakeLists.txt	2009-11-02 11:20:31 UTC (rev 24237)
@@ -24,14 +24,9 @@
 #
 # ***** END GPL LICENSE BLOCK *****
 
-IF(WITH_COCOA)
-	FILE(GLOB SRC intern/*.c intern/*.m)
-	LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/dynlibtiff.c")
-	LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/tiff.c")
-ELSE(WITH_COCOA)
-	FILE(GLOB SRC intern/*.c)
-ENDIF(WITH_COCOA)
+FILE(GLOB SRC intern/*.c)
 
+
 SET(INC 
 	. ../makesdna ../../../intern/guardedalloc ../../../intern/memutil ../blenlib
 	../avi ../blenkernel

Modified: trunk/blender/source/blender/imbuf/SConscript
===================================================================
--- trunk/blender/source/blender/imbuf/SConscript	2009-11-02 11:14:22 UTC (rev 24236)
+++ trunk/blender/source/blender/imbuf/SConscript	2009-11-02 11:20:31 UTC (rev 24237)
@@ -2,10 +2,6 @@
 Import ('env')
 
 sources = env.Glob('intern/*.c')
-if env['WITH_GHOST_COCOA']:
-	sources += env.Glob('intern/*.m')
-	sources.remove('intern/dynlibtiff.c')
-	sources.remove('intern/tiff.c')
 
 incs = '. ../makesdna #/intern/guardedalloc #/intern/memutil ../blenlib'
 incs += ' ../avi ../blenkernel'

Modified: trunk/blender/source/blender/imbuf/intern/dynlibtiff.c
===================================================================
--- trunk/blender/source/blender/imbuf/intern/dynlibtiff.c	2009-11-02 11:14:22 UTC (rev 24236)
+++ trunk/blender/source/blender/imbuf/intern/dynlibtiff.c	2009-11-02 11:20:31 UTC (rev 24237)
@@ -78,6 +78,34 @@
 	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;
+	//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;
+	//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;
+	//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;
+	//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;
+#else
 	libtiff = PIL_dynlib_open("libtiff.so");
 	if (libtiff != NULL)  return;
 	libtiff = PIL_dynlib_open("libtiff.so.3");
@@ -88,7 +116,6 @@
 	if (libtiff != NULL)  return;
 	libtiff = PIL_dynlib_open("/usr/lib/libtiff.so.3");
 	if (libtiff != NULL)  return;
-	/* OSX has version specific library */
 #ifdef __x86_64__
 	libtiff = PIL_dynlib_open("/usr/lib64/libtiff.so.3");
 	if (libtiff != NULL)  return;
@@ -97,6 +124,7 @@
 	if (libtiff != NULL)  return;
 	/* For solaris */
 	libtiff = PIL_dynlib_open("/usr/openwin/lib/libtiff.so");
+#endif
 
 }
 

Modified: trunk/blender/source/blender/imbuf/intern/readimage.c
===================================================================
--- trunk/blender/source/blender/imbuf/intern/readimage.c	2009-11-02 11:14:22 UTC (rev 24236)
+++ trunk/blender/source/blender/imbuf/intern/readimage.c	2009-11-02 11:20:31 UTC (rev 24237)
@@ -57,7 +57,7 @@
 #include "IMB_dpxcineon.h"
 #include "BKE_global.h"
 
-#if defined(__APPLE__) && defined(GHOST_COCOA)
+#if defined(__APPLE__) && defined(IMBUF_COCOA)
 #include "IMB_cocoa.h"
 #else
 #include "IMB_tiff.h"
@@ -157,7 +157,7 @@
 		ibuf = imb_loadcineon((uchar *)mem, size, flags);
 		if (ibuf) return(ibuf);
 	
-#if defined(__APPLE__) && defined(GHOST_COCOA)
+#if defined(__APPLE__) && defined(IMBUF_COCOA)
 		ibuf = imb_cocoaLoadImage((uchar *)mem, size, flags);
 		if(ibuf) {
 			ibuf->ftype = TIF;

Modified: trunk/blender/source/blender/imbuf/intern/writeimage.c
===================================================================
--- trunk/blender/source/blender/imbuf/intern/writeimage.c	2009-11-02 11:14:22 UTC (rev 24236)
+++ trunk/blender/source/blender/imbuf/intern/writeimage.c	2009-11-02 11:20:31 UTC (rev 24237)
@@ -53,7 +53,7 @@
 #include "IMB_bmp.h"
 #include "IMB_radiance_hdr.h"
 
-#if defined(__APPLE__) && defined(GHOST_COCOA)
+#if defined(__APPLE__) && defined(IMBUF_COCOA)
 #include "IMB_cocoa.h"
 #else
 #include "IMB_tiff.h"
@@ -119,7 +119,7 @@
 		return imb_saveiris(ibuf, name, flags);
 	}
 	
-#if defined(__APPLE__) && defined(GHOST_COCOA)
+#if defined(__APPLE__) && defined(IMBUF_COCOA)
 	if (IS_tiff(ibuf)) {
 		if(ibuf->rect==NULL && ibuf->rect_float)
 			IMB_rect_from_float(ibuf);

Modified: trunk/blender/source/blender/windowmanager/intern/wm_init_exit.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_init_exit.c	2009-11-02 11:14:22 UTC (rev 24236)
+++ trunk/blender/source/blender/windowmanager/intern/wm_init_exit.c	2009-11-02 11:20:31 UTC (rev 24237)
@@ -247,9 +247,7 @@
 	BPY_end_python();
 #endif
 
-#if !(defined(__APPLE__) && defined(GHOST_COCOA))
 	libtiff_exit();
-#endif
 	
 #ifdef WITH_QUICKTIME
 	quicktime_exit();

Modified: trunk/blender/source/creator/creator.c
===================================================================
--- trunk/blender/source/creator/creator.c	2009-11-02 11:14:22 UTC (rev 24236)
+++ trunk/blender/source/creator/creator.c	2009-11-02 11:20:31 UTC (rev 24237)
@@ -368,10 +368,8 @@
 			switch(argv[a][1]) {
 			case 'a': /* -b was not given, play an animation */
 				
-#if !(defined(__APPLE__) && defined(GHOST_COCOA))
 				/* exception here, see below, it probably needs happens after qt init? */
 				libtiff_init();
-#endif
 
 // XXX				playanim(argc-1, argv+1);
 				exit(0);
@@ -540,10 +538,6 @@
 
 #endif /* WITH_QUICKTIME */
 
-#if defined(__APPLE__) && defined(GHOST_COCOA)
-	/* libtiff is not used, Cocoa services are used instead for tiff I/O */
-	G.have_libtiff = 1;
-#else
 	/* dynamically load libtiff, if available */
 	libtiff_init();
 	if (!G.have_libtiff && (G.f & G_DEBUG)) {
@@ -551,7 +545,6 @@
 		printf("Try setting the BF_TIFF_LIB environment variable if you want this support.\n");
 		printf("Example: setenv BF_TIFF_LIB /usr/lib/libtiff.so\n");
 	}
-#endif
 
 	/* OK we are ready for it */
 





More information about the Bf-blender-cvs mailing list