oops, init status
This commit is contained in:
parent
57a8d8f12e
commit
9b3d081994
4
TODO
4
TODO
|
@ -7,6 +7,10 @@
|
||||||
- are we triggering im_fits2vips() in each thread?? argh, try tracing
|
- 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
|
- maybe im_draw_smudge() is too slow :-( also, we had a sanity failure with
|
||||||
it, argh
|
it, argh
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
*
|
*
|
||||||
* 26/10/10
|
* 26/10/10
|
||||||
* - from matlab.c
|
* - from matlab.c
|
||||||
|
* 27/10/10
|
||||||
|
* - oops, forgot to init status in close
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -81,6 +83,8 @@ read_destroy( Read *read )
|
||||||
if( read->fptr ) {
|
if( read->fptr ) {
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
|
status = 0;
|
||||||
|
|
||||||
if( fits_close_file( read->fptr, &status ) )
|
if( fits_close_file( read->fptr, &status ) )
|
||||||
read_error( status );
|
read_error( status );
|
||||||
|
|
||||||
|
@ -326,7 +330,7 @@ im_fits2vips( const char *filename, IMAGE *out )
|
||||||
Read *read;
|
Read *read;
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf( "fits2vips: reading \"%s\"\n", filename );
|
printf( "im_fits2vips: reading \"%s\"\n", filename );
|
||||||
#endif /*DEBUG*/
|
#endif /*DEBUG*/
|
||||||
|
|
||||||
if( !(read = read_new( filename, out )) )
|
if( !(read = read_new( filename, out )) )
|
||||||
|
@ -348,6 +352,10 @@ isfits( const char *filename )
|
||||||
fitsfile *fptr;
|
fitsfile *fptr;
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf( "isfits: testing \"%s\"\n", filename );
|
||||||
|
#endif /*DEBUG*/
|
||||||
|
|
||||||
status = 0;
|
status = 0;
|
||||||
|
|
||||||
if( fits_open_image( &fptr, filename, READONLY, &status ) ) {
|
if( fits_open_image( &fptr, filename, READONLY, &status ) ) {
|
||||||
|
|
|
@ -98,6 +98,8 @@ Modified:
|
||||||
* - write to non-vips formats with a "written" callback
|
* - write to non-vips formats with a "written" callback
|
||||||
* 29/7/10
|
* 29/7/10
|
||||||
* - disc open threshold stuff, open to disc mode
|
* - 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 );
|
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 {
|
typedef struct {
|
||||||
const char unit;
|
const char unit;
|
||||||
int multiplier;
|
int multiplier;
|
||||||
|
@ -345,9 +329,9 @@ lazy_image( Lazy *lazy )
|
||||||
disc_threshold() &&
|
disc_threshold() &&
|
||||||
!(vips_format_get_flags( lazy->format, lazy->out->filename ) &
|
!(vips_format_get_flags( lazy->format, lazy->out->filename ) &
|
||||||
VIPS_FORMAT_PARTIAL) ) {
|
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( size > disc_threshold() ) {
|
||||||
if( !(im = im__open_temp( "%s.v" )) )
|
if( !(im = im__open_temp( "%s.v" )) )
|
||||||
return( NULL );
|
return( NULL );
|
||||||
|
|
Loading…
Reference in New Issue