oops, init status

This commit is contained in:
John Cupitt 2010-10-27 15:49:57 +00:00
parent 57a8d8f12e
commit 9b3d081994
3 changed files with 17 additions and 21 deletions

4
TODO
View File

@ -7,6 +7,10 @@
- are we triggering im_fits2vips() in each thread?? argh, try tracing
- maybe im_draw_smudge() is too slow :-( also, we had a sanity failure with
it, argh

View File

@ -2,6 +2,8 @@
*
* 26/10/10
* - from matlab.c
* 27/10/10
* - oops, forgot to init status in close
*/
/*
@ -81,6 +83,8 @@ read_destroy( Read *read )
if( read->fptr ) {
int status;
status = 0;
if( fits_close_file( read->fptr, &status ) )
read_error( status );
@ -326,7 +330,7 @@ im_fits2vips( const char *filename, IMAGE *out )
Read *read;
#ifdef DEBUG
printf( "fits2vips: reading \"%s\"\n", filename );
printf( "im_fits2vips: reading \"%s\"\n", filename );
#endif /*DEBUG*/
if( !(read = read_new( filename, out )) )
@ -348,6 +352,10 @@ isfits( const char *filename )
fitsfile *fptr;
int status;
#ifdef DEBUG
printf( "isfits: testing \"%s\"\n", filename );
#endif /*DEBUG*/
status = 0;
if( fits_open_image( &fptr, filename, READONLY, &status ) ) {

View File

@ -98,6 +98,8 @@ Modified:
* - write to non-vips formats with a "written" callback
* 29/7/10
* - disc open threshold stuff, open to disc mode
* 27/10/10
* - oops, guess_size was unnecessary
*/
/*
@ -241,24 +243,6 @@ lazy_new( IMAGE *out, VipsFormatClass *format, gboolean disc )
return( lazy );
}
static size_t
guess_size( VipsFormatClass *format, const char *filename )
{
IMAGE *im;
size_t size;
if( !(im = im_open( "header", "p" )) )
return( 0 );
if( format->header( filename, im ) ) {
im_close( im );
return( 0 );
}
size = IM_IMAGE_SIZEOF_LINE( im ) * im->Ysize;
im_close( im );
return( size );
}
typedef struct {
const char unit;
int multiplier;
@ -345,9 +329,9 @@ lazy_image( Lazy *lazy )
disc_threshold() &&
!(vips_format_get_flags( lazy->format, lazy->out->filename ) &
VIPS_FORMAT_PARTIAL) ) {
size_t size;
size_t size = IM_IMAGE_SIZEOF_LINE( lazy->out ) *
lazy->out->Ysize;
size = guess_size( lazy->format, lazy->out->filename );
if( size > disc_threshold() ) {
if( !(im = im__open_temp( "%s.v" )) )
return( NULL );