2006.04.04 03:28 "Re: [Tiff] New OJPEG support", by Bob Friesenhahn
- I've not been able to test the longjump way to call LibJpeg functions... Some environments don't support longjump. This includes my own LibTiffDelphi build. Thus, I've included an alternative way of calling, triggered by the optional define LIBJPEG_ENCAP_EXTERNAL. If you define that, LibJpeg doesn't get called directly, but you have a chance to implement dedicated call encapsulators outside of tif_ojpeg.c. The use with this LIBJPEG_ENCAP_EXTERNAL is tested, but the default, direct longjump call usage without LIBJPEG_ENCAP_EXTERNAL is not. I must depend on you to do that and report any problems. Default is normal longjump, so you likely don't need to change anything.
Looks like you need to do
#include <setjmp.h>
in order to obtain a definition for jmp_buf. Otherwise compilation
fails at
JMP_BUF exit_jmpbuf;
This is ANSI C '89 standard so it should be reliable.
After including the missing header compilation fails at line 2217:
jpeg_create_decompress_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo)
{
SETJMP(sp->exit_jmpbuf)?
return(0):
{
jpeg_create_decompress(cinfo);
return(1);
}
}
With error:
/home/bfriesen/src/graphics/libtiff/libtiff/tif_ojpeg.c: In function 'jpeg_create_decompress_encap':
/home/bfriesen/src/graphics/libtiff/libtiff/tif_ojpeg.c:2217: error: syntax error before 'return'
There are many similar errors.
It seems wise to at least test compilation in longjmp mode even if you can't use the result under Delphi.
Bob