This commit is contained in:
John Cupitt 2008-02-20 19:10:02 +00:00
parent 4a8b4add78
commit a6b0d8471b
4 changed files with 32 additions and 20 deletions

5
TODO
View File

@ -8,6 +8,11 @@
maybe just link with g++ instead of gcc? how can we do this? put a
dummy.cpp into libsrc?
or do we only need to link the cimg convenience library with g++? libtool
should copy the libs up, shouldn't it?
add a --without-cimg option too
- test maxpos_avg, quite a few changes
WONTFIX

View File

@ -43,7 +43,7 @@
* - ooops, else missing for subsample stuff above
* 2/10/99 JC
* - tiled 16-bit greyscale read was broken
* - added mutex for TIFF*() calls
* - added mutex for TIFFReadTile() calls
* 11/5/00 JC
* - removed TIFFmalloc/TIFFfree usage
* 23/4/01 JC
@ -225,16 +225,18 @@ typedef struct {
void *table;
} YCbCrParams;
/* Handle TIFF errors here.
/* Handle TIFF errors here. Shared with im_vips2tiff. These can be called from
* more than one thread, but im_error and im_warn have mutexes in, so that's
* OK.
*/
static void
thandler_error( char *module, char *fmt, va_list ap )
void
im__thandler_error( char *module, char *fmt, va_list ap )
{
im_verror( module, fmt, ap );
}
static void
thandler_warning( char *module, char *fmt, va_list ap )
void
im__thandler_warning( char *module, char *fmt, va_list ap )
{
char buf[256];
@ -1426,8 +1428,8 @@ im_istiffpyramid( const char *name )
{
TIFF *tif;
TIFFSetErrorHandler( (TIFFErrorHandler) thandler_error );
TIFFSetWarningHandler( (TIFFErrorHandler) thandler_warning );
TIFFSetErrorHandler( (TIFFErrorHandler) im__thandler_error );
TIFFSetWarningHandler( (TIFFErrorHandler) im__thandler_warning );
if( (tif = get_directory( name, 2 )) ) {
/* We can see page 2 ... assume it is.
@ -1448,8 +1450,8 @@ im_tiff2vips( const char *filename, IMAGE *out )
printf( "im_tiff2vips: libtiff version is \"%s\"\n", TIFFGetVersion() );
#endif /*DEBUG*/
TIFFSetErrorHandler( (TIFFErrorHandler) thandler_error );
TIFFSetWarningHandler( (TIFFErrorHandler) thandler_warning );
TIFFSetErrorHandler( (TIFFErrorHandler) im__thandler_error );
TIFFSetWarningHandler( (TIFFErrorHandler) im__thandler_warning );
if( !(rtiff = readtiff_new( filename, out )) )
return( -1 );
@ -1479,8 +1481,8 @@ im_tiff2vips_header( const char *filename, IMAGE *out )
{
ReadTiff *rtiff;
TIFFSetErrorHandler( (TIFFErrorHandler) thandler_error );
TIFFSetWarningHandler( (TIFFErrorHandler) thandler_warning );
TIFFSetErrorHandler( (TIFFErrorHandler) im__thandler_error );
TIFFSetWarningHandler( (TIFFErrorHandler) im__thandler_warning );
if( !(rtiff = readtiff_new( filename, out )) )
return( -1 );

View File

@ -96,6 +96,8 @@
* 15/2/08
* - set TIFFTAG_JPEGQUALITY explicitly when we copy TIFF files, since
* libtiff doesn't keep this in the header (thanks Joe)
* 20/2/08
* - use tiff error handler from im_tiff2vips.c
*/
/*
@ -237,14 +239,10 @@ typedef struct tiff_write {
char *icc_profile; /* Profile to embed */
} TiffWrite;
/* Handle TIFF errors here.
/* Use these from im_tiff2vips().
*/
static void
vhandle( char *module, char *fmt, va_list ap )
{
im_error( "im_vips2tiff", _( "TIFF error in \"%s\": " ), module );
im_verror( "im_vips2tiff", fmt, ap );
}
void im__thandler_error( char *module, char *fmt, va_list ap );
void im__thandler_warning( char *module, char *fmt, va_list ap );
/* Open TIFF for output.
*/
@ -1527,7 +1525,8 @@ im_vips2tiff( IMAGE *im, const char *filename )
/* Override the default TIFF error handler.
*/
TIFFSetErrorHandler( (TIFFErrorHandler) vhandle );
TIFFSetErrorHandler( (TIFFErrorHandler) im__thandler_error );
TIFFSetWarningHandler( (TIFFErrorHandler) im__thandler_warning );
/* Check input image.
*/

View File

@ -12,6 +12,8 @@
* - i18n added, domain now separate arg
* 14/2/07
* - lock around error buffer changes
* 20/2/08
* - lock around warnings and diagnostics too, why not
*/
/*
@ -160,10 +162,12 @@ void
im_vdiag( const char *domain, const char *fmt, va_list ap )
{
if( !g_getenv( IM_DIAGNOSTICS ) ) {
g_mutex_lock( im__global_lock );
(void) fprintf( stderr, _( "%s: " ), _( "vips diagnostic" ) );
(void) fprintf( stderr, _( "%s: " ), domain );
(void) vfprintf( stderr, fmt, ap );
(void) fprintf( stderr, "\n" );
g_mutex_unlock( im__global_lock );
}
}
@ -181,10 +185,12 @@ void
im_vwarn( const char *domain, const char *fmt, va_list ap )
{
if( !g_getenv( IM_WARNING ) ) {
g_mutex_lock( im__global_lock );
(void) fprintf( stderr, _( "%s: " ), _( "vips warning" ) );
(void) fprintf( stderr, _( "%s: " ), domain );
(void) vfprintf( stderr, fmt, ap );
(void) fprintf( stderr, "\n" );
g_mutex_unlock( im__global_lock );
}
}