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
This commit is contained in:
2005-12-02 21:13:14 +00:00
parent 6ba27d69b0
commit 6263390e73
4 changed files with 29 additions and 12 deletions

View File

@@ -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");

View File

@@ -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())

View File

@@ -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;

View File

@@ -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: