diff options
author | Kent Mein <mein@cs.umn.edu> | 2005-12-03 00:13:14 +0300 |
---|---|---|
committer | Kent Mein <mein@cs.umn.edu> | 2005-12-03 00:13:14 +0300 |
commit | 6263390e73edb77a79c452b1e3b121987555590e (patch) | |
tree | d852e2583c903febf41ea5902e2503747512ca5d /source | |
parent | 6ba27d69b003c7c7c6ca9513a0c60eeed1aa8d11 (diff) |
This commit does very little for the number of files touched.
I updated gen_dynlibtiff.py so its in sync with the file(s) it creates.
I added a little more documentation to the readme.txt for adding
new file formats.
I also added two dummy functions to the tiff.c so it stopped whining
about them being NULL.
(I'm still working on the reported bugs but thought this was a good time
to at least get this in)
Kent
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/imbuf/intern/dynlibtiff.c | 5 | ||||
-rwxr-xr-x | source/blender/imbuf/intern/gen_dynlibtiff.py | 16 | ||||
-rw-r--r-- | source/blender/imbuf/intern/tiff.c | 15 | ||||
-rw-r--r-- | source/blender/imbuf/readme.txt | 5 |
4 files changed, 29 insertions, 12 deletions
diff --git a/source/blender/imbuf/intern/dynlibtiff.c b/source/blender/imbuf/intern/dynlibtiff.c index 7472764b7df..a770ee95547 100644 --- a/source/blender/imbuf/intern/dynlibtiff.c +++ b/source/blender/imbuf/intern/dynlibtiff.c @@ -76,8 +76,7 @@ void libtiff_loadlibtiff(void) char *filename; libtiff = NULL; -#ifndef __APPLE__ /* no standard location of libtiff in MacOS X */ - /* declare env var if you want to use that */ +#ifndef __APPLE__ /* no standard location of libtiff in MacOS X */ /* Try to find libtiff in a couple of standard places */ libtiff = PIL_dynlib_open("libtiff.so"); @@ -94,7 +93,7 @@ void libtiff_loadlibtiff(void) /* For solaris */ libtiff = PIL_dynlib_open("/usr/openwin/lib/libtiff.so"); if (libtiff != NULL) return; - + #endif filename = getenv("BF_TIFF_LIB"); diff --git a/source/blender/imbuf/intern/gen_dynlibtiff.py b/source/blender/imbuf/intern/gen_dynlibtiff.py index 70bda45f214..02c7e6e856c 100755 --- a/source/blender/imbuf/intern/gen_dynlibtiff.py +++ b/source/blender/imbuf/intern/gen_dynlibtiff.py @@ -104,20 +104,22 @@ C_EXTRA = \ * LOCAL DEFINITIONS * *********************/ PILdynlib *libtiff = NULL; -void libtiff_loadlibtiff(); +void libtiff_loadlibtiff(void); void* libtiff_findsymbol(char*); -int libtiff_load_symbols(); +int libtiff_load_symbols(void); /************************** * LIBRARY INITIALIZATION * **************************/ -void libtiff_loadlibtiff() +void libtiff_loadlibtiff(void) { char *filename; libtiff = NULL; +#ifndef __APPLE__ /* no standard location of libtiff in MacOS X */ + /* Try to find libtiff in a couple of standard places */ libtiff = PIL_dynlib_open("libtiff.so"); if (libtiff != NULL) return; @@ -134,6 +136,8 @@ void libtiff_loadlibtiff() libtiff = PIL_dynlib_open("/usr/openwin/lib/libtiff.so"); if (libtiff != NULL) return; +#endif + filename = getenv("BF_TIFF_LIB"); if (filename) libtiff = PIL_dynlib_open(filename); } @@ -153,7 +157,7 @@ void *libtiff_findsymbol(char *name) return symbol; } -void libtiff_init() +void libtiff_init(void) { if (libtiff != NULL) { printf("libtiff_init: Attempted to load libtiff twice!\\n"); @@ -163,7 +167,7 @@ void libtiff_init() G.have_libtiff = ((libtiff != NULL) && (libtiff_load_symbols())); } -void libtiff_exit() +void libtiff_exit(void) { if (libtiff != NULL) { PIL_dynlib_close(libtiff); @@ -220,7 +224,7 @@ def outputDynCFile(outfile, header_file_name): outfile.write(COMMENT) outfile.write('#include "%s"\n' % header_file_name) outfile.write(C_EXTRA) - outfile.write('int libtiff_load_symbols()\n') + outfile.write('int libtiff_load_symbols(void)\n') outfile.write('{\n') for function in tiff_functions: outfile.write(function.getLoadSymbol()) diff --git a/source/blender/imbuf/intern/tiff.c b/source/blender/imbuf/intern/tiff.c index 9f5ecf18dd9..361ae9d198f 100644 --- a/source/blender/imbuf/intern/tiff.c +++ b/source/blender/imbuf/intern/tiff.c @@ -69,6 +69,10 @@ tsize_t imb_tiff_WriteProc(thandle_t handle, tdata_t data, tsize_t n); toff_t imb_tiff_SeekProc(thandle_t handle, toff_t ofs, int whence); int imb_tiff_CloseProc(thandle_t handle); toff_t imb_tiff_SizeProc(thandle_t handle); +int imb_tiff_DummyMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize); +void imb_tiff_DummyUnmapProc(thandle_t fd, tdata_t base, toff_t size); + + /* Structure for in-memory TIFF file. */ struct ImbTIFFMemFile { unsigned char *mem; /* Location of first byte of TIFF file. */ @@ -84,6 +88,14 @@ struct ImbTIFFMemFile { *****************************/ +void imb_tiff_DummyUnmapProc(thandle_t fd, tdata_t base, toff_t size) +{ +} + +int imb_tiff_DummyMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize) +{ + return (0); +} /** * Reads data from an in-memory TIFF file. @@ -308,8 +320,7 @@ struct ImBuf *imb_loadtiff(unsigned char *mem, int size, int flags) "r", (thandle_t)(&memFile), imb_tiff_ReadProc, imb_tiff_WriteProc, imb_tiff_SeekProc, imb_tiff_CloseProc, - imb_tiff_SizeProc, (TIFFMapFileProc)NULL, - (TIFFUnmapFileProc)NULL); + imb_tiff_SizeProc, imb_tiff_DummyMapProc, imb_tiff_DummyUnmapProc); if (image == NULL) { printf("imb_loadtiff: could not open TIFF IO layer.\n"); return NULL; diff --git a/source/blender/imbuf/readme.txt b/source/blender/imbuf/readme.txt index 8f04eec9131..181d5485310 100644 --- a/source/blender/imbuf/readme.txt +++ b/source/blender/imbuf/readme.txt @@ -30,7 +30,10 @@ source/blender/src/toets.c source/blender/src/writeimage.c Step 5: -edit blender/source/blender/imbuf/intern/util.c +edit the following files: +blender/source/blender/imbuf/intern/util.c +blender/source/blender/src/filesel.c +blender/source/blender/src/screendump.c and add your extension so that your format gets recognized in the thumbnails. Step 6: |