stuff
This commit is contained in:
parent
f7c11c9722
commit
a82fe054e6
@ -108,8 +108,7 @@ im_cp_desc_array( IMAGE *out, IMAGE *in[] )
|
|||||||
*/
|
*/
|
||||||
im__meta_destroy( out );
|
im__meta_destroy( out );
|
||||||
for( i = ni - 1; i >= 0; i-- )
|
for( i = ni - 1; i >= 0; i-- )
|
||||||
if( im_image_sanity( in[i] ) ||
|
if( im__meta_cp( out, in[i] ) )
|
||||||
im__meta_cp( out, in[i] ) )
|
|
||||||
return( -1 );
|
return( -1 );
|
||||||
|
|
||||||
/* Merge hists first to last.
|
/* Merge hists first to last.
|
||||||
|
@ -375,8 +375,8 @@ im_generate( IMAGE *im,
|
|||||||
REGION *or;
|
REGION *or;
|
||||||
im_threadgroup_t *tg;
|
im_threadgroup_t *tg;
|
||||||
|
|
||||||
if( im_image_sanity( im ) )
|
im_image_sanity( im );
|
||||||
return( -1 );
|
|
||||||
if( im->Xsize <= 0 || im->Ysize <= 0 || im->Bands <= 0 ) {
|
if( im->Xsize <= 0 || im->Ysize <= 0 || im->Bands <= 0 ) {
|
||||||
im_error( "im_generate", _( "bad dimensions" ) );
|
im_error( "im_generate", _( "bad dimensions" ) );
|
||||||
return( -1 );
|
return( -1 );
|
||||||
@ -474,8 +474,7 @@ im_prepare_thread( im_threadgroup_t *tg, REGION *or, Rect *r )
|
|||||||
{
|
{
|
||||||
IMAGE *im = or->im;
|
IMAGE *im = or->im;
|
||||||
|
|
||||||
if( im_image_sanity( im ) )
|
im_image_sanity( im );
|
||||||
return( -1 );
|
|
||||||
|
|
||||||
switch( im->dtype ) {
|
switch( im->dtype ) {
|
||||||
case IM_PARTIAL:
|
case IM_PARTIAL:
|
||||||
|
@ -147,8 +147,7 @@ convert_otom( IMAGE *im )
|
|||||||
int
|
int
|
||||||
im_incheck( IMAGE *im )
|
im_incheck( IMAGE *im )
|
||||||
{
|
{
|
||||||
if( im_image_sanity( im ) )
|
im_image_sanity( im );
|
||||||
return( -1 );
|
|
||||||
|
|
||||||
#ifdef DEBUG_IO
|
#ifdef DEBUG_IO
|
||||||
printf( "im_incheck: old-style input for %s\n", im->filename );
|
printf( "im_incheck: old-style input for %s\n", im->filename );
|
||||||
@ -174,7 +173,7 @@ im_incheck( IMAGE *im )
|
|||||||
|
|
||||||
case IM_PARTIAL:
|
case IM_PARTIAL:
|
||||||
#ifdef DEBUG_IO
|
#ifdef DEBUG_IO
|
||||||
printf( "im_incheck: converting partial image for old-style input\n" );
|
printf( "im_incheck: converting partial image to WIO\n" );
|
||||||
#endif/*DEBUG_IO*/
|
#endif/*DEBUG_IO*/
|
||||||
|
|
||||||
/* Change to a setbuf, so our caller can use it.
|
/* Change to a setbuf, so our caller can use it.
|
||||||
|
@ -203,8 +203,7 @@ im_iterate( IMAGE *im,
|
|||||||
im_threadgroup_t *tg;
|
im_threadgroup_t *tg;
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
if( im_image_sanity( im ) )
|
im_image_sanity( im );
|
||||||
return( -1 );
|
|
||||||
|
|
||||||
if( !(t = im_open( "iterate", "p" )) )
|
if( !(t = im_open( "iterate", "p" )) )
|
||||||
return( -1 );
|
return( -1 );
|
||||||
|
@ -671,6 +671,8 @@ im_image_sanity( IMAGE *im )
|
|||||||
im ? (im->filename ? im->filename : "") : "",
|
im ? (im->filename ? im->filename : "") : "",
|
||||||
im, msg );
|
im, msg );
|
||||||
im_printdesc( im );
|
im_printdesc( im );
|
||||||
|
|
||||||
|
return( -1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
return( 0 );
|
return( 0 );
|
||||||
|
@ -77,8 +77,7 @@
|
|||||||
int
|
int
|
||||||
im_pincheck( IMAGE *im )
|
im_pincheck( IMAGE *im )
|
||||||
{
|
{
|
||||||
if( im_image_sanity( im ) )
|
im_image_sanity( im );
|
||||||
return( -1 );
|
|
||||||
|
|
||||||
#ifdef DEBUG_IO
|
#ifdef DEBUG_IO
|
||||||
printf( "im_pincheck: enabling partial input for %s\n", im->filename );
|
printf( "im_pincheck: enabling partial input for %s\n", im->filename );
|
||||||
|
@ -91,8 +91,8 @@
|
|||||||
int
|
int
|
||||||
im_setupout( IMAGE *im )
|
im_setupout( IMAGE *im )
|
||||||
{
|
{
|
||||||
if( im_image_sanity( im ) )
|
im_image_sanity( im );
|
||||||
return( -1 );
|
|
||||||
if( im->Xsize <= 0 || im->Ysize <= 0 || im->Bands <= 0 ) {
|
if( im->Xsize <= 0 || im->Ysize <= 0 || im->Bands <= 0 ) {
|
||||||
im_error( "im_setupout", _( "bad dimensions" ) );
|
im_error( "im_setupout", _( "bad dimensions" ) );
|
||||||
return( -1 );
|
return( -1 );
|
||||||
|
@ -9,7 +9,7 @@ int im_image_sanity( IMAGE *im )
|
|||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.B im_image_sanity(3)
|
.B im_image_sanity(3)
|
||||||
performs a few simple checks on the IMAGE for bad fields. If it finds a
|
performs a few simple checks on the IMAGE for bad fields. If it finds a
|
||||||
problem, it returns -1, serts im_errorstring, and prints a warning message.
|
problem it prints a warning message and returns -1.
|
||||||
|
|
||||||
It is called from various places within VIPS to try to catch errors early.
|
It is called from various places within VIPS to try to catch errors early.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user