patches for ubuntu 8.10

This commit is contained in:
John Cupitt 2008-11-02 22:11:01 +00:00
parent 9e9fb58644
commit d6205c1068
130 changed files with 599 additions and 464 deletions

2
TODO
View File

@ -1,3 +1,5 @@
- relational/video still to do
- built with O2, experiment with
- floorf()

View File

@ -157,7 +157,7 @@ AC_CHECK_TOOL(STRIP, strip)
AC_CHECK_TOOL(AR, ar)
AC_CHECK_TOOL(AS, as)
AC_CHECK_TOOL(LD, ld)
AC_PROVIDE(AC_LIBTOOL_WIN32_DLL)
AC_PROVIDE([AC_LIBTOOL_WIN32_DLL])
AC_PROG_LIBTOOL
# Checks for typedefs, structures, and compiler characteristics.

View File

@ -67,12 +67,12 @@ if( im_iocheck( in, out ) )
return( -1 );
if( in->Bbits != 8 ||
in->Coding != IM_CODING_NONE || in->BandFmt != IM_BANDFMT_UCHAR ) {
im_error( "im_clamp", _( "bad input format" ) );
im_error( "im_clamp", "%s", _( "bad input format" ) );
return( -1 );
}
if( black->Bbits != 8 ||
black->Coding != IM_CODING_NONE || black->BandFmt != IM_BANDFMT_UCHAR ) {
im_error( "im_clamp", _( "bad black format" ) );
im_error( "im_clamp", "%s", _( "bad black format" ) );
return( -1 );
}

View File

@ -453,7 +453,8 @@ lintra_vec_vec( im_object *argv )
im_doublevec_object *dvb = (im_doublevec_object *) argv[2];
if( dva->n != dvb->n ) {
im_error( "im_lintra_vec", _( "vectors not same length" ) );
im_error( "im_lintra_vec",
"%s", _( "vectors not equal length" ) );
return( -1 );
}

View File

@ -218,7 +218,7 @@ im_abs( IMAGE *in, IMAGE *out )
/* Check args.
*/
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_abs", _( "not uncoded" ) );
im_error( "im_abs", "%s", _( "not uncoded" ) );
return( -1 );
}
@ -254,7 +254,7 @@ im_abs( IMAGE *in, IMAGE *out )
break;
default:
im_error( "im_abs", _( "unknown input type" ) );
im_error( "im_abs", "%s", _( "unknown input type" ) );
return( -1 );
}

View File

@ -192,7 +192,7 @@ im__bandup( IMAGE *in, IMAGE *out, int n )
return( -1 );
}
if( n > 256 || n < 1 ) {
im_error( "im__bandup", _( "bad bands" ) );
im_error( "im__bandup", "%s", _( "bad bands" ) );
return( -1 );
}
@ -248,11 +248,11 @@ im_add( IMAGE *in1, IMAGE *in2, IMAGE *out )
return( -1 );
if( in1->Bands != in2->Bands &&
(in1->Bands != 1 && in2->Bands != 1) ) {
im_error( "im_add", _( "not same number of bands" ) );
im_error( "im_add", "%s", _( "not same number of bands" ) );
return( -1 );
}
if( in1->Coding != IM_CODING_NONE || in2->Coding != IM_CODING_NONE ) {
im_error( "im_add", _( "not uncoded" ) );
im_error( "im_add", "%s", _( "not uncoded" ) );
return( -1 );
}
if( im_cp_descv( out, in1, in2, NULL ) )

View File

@ -184,11 +184,11 @@ im_avg( IMAGE *in, double *out )
if( im_pincheck( in ) )
return( -1 );
if( im_iscomplex( in ) ) {
im_error( "im_avg", _( "bad input type" ) );
im_error( "im_avg", "%s", _( "bad input type" ) );
return( -1 );
}
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_avg", _( "not uncoded" ) );
im_error( "im_avg", "%s", _( "not uncoded" ) );
return( -1 );
}

View File

@ -139,7 +139,7 @@ im_bandmean( IMAGE *in, IMAGE *out )
if( in->Bands == 1 )
return( im_copy( in, out ) );
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_bandmean", _( "uncoded multiband only" ) );
im_error( "im_bandmean", "%s", _( "uncoded multiband only" ) );
return( -1 );
}

View File

@ -89,7 +89,7 @@ im_ceil( IMAGE *in, IMAGE *out )
/* Check args.
*/
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_ceil", _( "not uncoded" ) );
im_error( "im_ceil", "%s", _( "not uncoded" ) );
return( -1 );
}

View File

@ -114,11 +114,11 @@ im_costra( IMAGE *in, IMAGE *out )
if( im_piocheck( in, out ) )
return( -1 );
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_costra", _( "not uncoded" ) );
im_error( "im_costra", "%s", _( "not uncoded" ) );
return( -1 );
}
if( im_iscomplex( in ) ) {
im_error( "im_costra", _( "bad input type" ) );
im_error( "im_costra", "%s", _( "bad input type" ) );
return( -1 );
}
@ -199,11 +199,11 @@ im_acostra( IMAGE *in, IMAGE *out )
if( im_piocheck( in, out ) )
return( -1 );
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_acostra", _( "not uncoded" ) );
im_error( "im_acostra", "%s", _( "not uncoded" ) );
return( -1 );
}
if( im_iscomplex( in ) ) {
im_error( "im_acostra", _( "bad input type" ) );
im_error( "im_acostra", "%s", _( "bad input type" ) );
return( -1 );
}

View File

@ -196,11 +196,11 @@ im_deviate( IMAGE *in, double *out )
if( im_pincheck( in ) )
return( -1 );
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_deviate", _( "not uncoded" ) );
im_error( "im_deviate", "%s", _( "not uncoded" ) );
return( -1 );
}
if( im_iscomplex( in ) ) {
im_error( "im_deviate", _( "bad input type" ) );
im_error( "im_deviate", "%s", _( "bad input type" ) );
return( -1 );
}

View File

@ -179,11 +179,11 @@ im_divide( IMAGE *in1, IMAGE *in2, IMAGE *out )
return( -1 );
if( in1->Bands != in2->Bands &&
(in1->Bands != 1 && in2->Bands != 1) ) {
im_error( "im_divide", _( "not same number of bands" ) );
im_error( "im_divide", "%s", _( "not same number of bands" ) );
return( -1 );
}
if( in1->Coding != IM_CODING_NONE || in2->Coding != IM_CODING_NONE ) {
im_error( "im_divide", _( "not uncoded" ) );
im_error( "im_divide", "%s", _( "not uncoded" ) );
return( -1 );
}
if( im_cp_descv( out, in1, in2, NULL ) )

View File

@ -181,11 +181,11 @@ im_expntra_vec( IMAGE *in, IMAGE *out, int n, double *e )
/* Check args.
*/
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_expntra_vec", _( "not uncoded" ) );
im_error( "im_expntra_vec", "%s", _( "not uncoded" ) );
return( -1 );
}
if( im_iscomplex( in ) ) {
im_error( "im_expntra_vec", _( "not non-complex" ) );
im_error( "im_expntra_vec", "%s", _( "not non-complex" ) );
return( -1 );
}
if( n != 1 && n != in->Bands ) {

View File

@ -103,7 +103,7 @@ im_floor( IMAGE *in, IMAGE *out )
/* Check args.
*/
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_floor", _( "not uncoded" ) );
im_error( "im_floor", "%s", _( "not uncoded" ) );
return( -1 );
}

View File

@ -88,7 +88,7 @@ double a, b, c;
case IM_BANDFMT_DOUBLE:
flagfloat = 1;
break;
default: im_error("im_gadd",_("Unable to accept image1"));
default: im_error("im_gadd","%s", _("Unable to accept image1"));
return(-1);
}
switch(in2->BandFmt) {
@ -104,7 +104,7 @@ double a, b, c;
case IM_BANDFMT_DOUBLE:
flagfloat = 1;
break;
default: im_error("im_gadd",_("Unable to accept image1"));
default: im_error("im_gadd","%s", _("Unable to accept image1"));
return(-1);
}
/* Select output routines */

View File

@ -116,11 +116,11 @@ im_invert( IMAGE *in, IMAGE *out )
/* Check args.
*/
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_invert", _( "not uncoded" ) );
im_error( "im_invert", "%s", _( "not uncoded" ) );
return( -1 );
}
if( in->BandFmt != IM_BANDFMT_UCHAR ) {
im_error( "im_invert", _( "not UCHAR" ) );
im_error( "im_invert", "%s", _( "not UCHAR" ) );
return( -1 );
}
if( im_piocheck( in, out ) )

View File

@ -317,7 +317,7 @@ im_lintra_vec( int n, double *a, IMAGE *in, double *b, IMAGE *out )
/* Check args.
*/
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_lintra_vec", _( "not uncoded" ) );
im_error( "im_lintra_vec", "%s", _( "not uncoded" ) );
return( -1 );
}

View File

@ -121,11 +121,11 @@ im_log10tra( IMAGE *in, IMAGE *out )
if( im_piocheck( in, out ) )
return( -1 );
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_log10tra", _( "not uncoded" ) );
im_error( "im_log10tra", "%s", _( "not uncoded" ) );
return( -1 );
}
if( im_iscomplex( in ) ) {
im_error( "im_log10tra", _( "not non-complex" ) );
im_error( "im_log10tra", "%s", _( "not non-complex" ) );
return( -1 );
}

View File

@ -121,11 +121,11 @@ im_logtra( IMAGE *in, IMAGE *out )
if( im_piocheck( in, out ) )
return( -1 );
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_logtra", _( "not uncoded" ) );
im_error( "im_logtra", "%s", _( "not uncoded" ) );
return( -1 );
}
if( im_iscomplex( in ) ) {
im_error( "im_logtra", _( "not non-complex" ) );
im_error( "im_logtra", "%s", _( "not non-complex" ) );
return( -1 );
}

View File

@ -236,7 +236,7 @@ im_max( IMAGE *in, double *out )
if( im_pincheck( in ) )
return( -1 );
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_max", _( "not uncoded" ) );
im_error( "im_max", "%s", _( "not uncoded" ) );
return( -1 );
}

View File

@ -91,7 +91,7 @@ im_maxpos( IMAGE *in, int *xpos, int *ypos, double *out )
if( im_incheck( in ) )
return( -1 );
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_maxpos", _( "not uncoded" ) );
im_error( "im_maxpos", "%s", _( "not uncoded" ) );
return( -1 );
}

View File

@ -92,19 +92,19 @@ int im_maxpos_avg( IMAGE *im, double *xpos, double *ypos, double *out ){
return -1;
if( im-> Coding ){
im_error( FUNCTION_NAME, _("uncoded images only") );
im_error( FUNCTION_NAME, "%s", _("uncoded images only") );
return -1;
}
if( !( im_isint( im ) || im_isfloat( im ) ) ){
im_error( FUNCTION_NAME, _("scalar images only") );
im_error( FUNCTION_NAME, "%s", _("scalar images only") );
return -1;
}
if( 1 != im-> Bands ){
im_error( FUNCTION_NAME, _("single band images only") );
im_error( FUNCTION_NAME, "%s", _("single band images only") );
return -1;
}
if( ! xpos || ! ypos || ! out ){
im_error( FUNCTION_NAME, _("invalid argument") );
im_error( FUNCTION_NAME, "%s", _("invalid argument") );
return -1;
}
if( im_iterate( im, maxpos_avg_start, maxpos_avg_scan, maxpos_avg_stop, &master, NULL ) )

View File

@ -119,22 +119,22 @@ int im_maxpos_vec( IMAGE *im, int *xpos, int *ypos, double *maxima, int n ){
return -1;
if( ! ( im_isint( im ) || im_isfloat( im ) ) ){
im_error( FUNCTION_NAME, _( "scalar images only" ) );
im_error( FUNCTION_NAME, "%s", _( "scalar images only" ) );
return -1;
}
if( 1 != im-> Bands ){
im_error( FUNCTION_NAME, _( "single band images only" ) );
im_error( FUNCTION_NAME, "%s", _( "single band images only" ) );
return -1;
}
if( IM_CODING_NONE != im-> Coding ){
im_error( FUNCTION_NAME, _( "uncoded images only" ) );
im_error( FUNCTION_NAME, "%s", _( "uncoded images only" ) );
return -1;
}
if( ! xpos || ! ypos || ! maxima || n < 1 ){
im_error( FUNCTION_NAME, _( "invalid argument" ) );
im_error( FUNCTION_NAME, "%s", _( "invalid argument" ) );
return -1;
}
@ -165,22 +165,22 @@ int im_minpos_vec( IMAGE *im, int *xpos, int *ypos, double *minima, int n ){
return -1;
if( ! ( im_isint( im ) || im_isfloat( im ) ) ){
im_error( FUNCTION_NAME, _( "scalar images only" ) );
im_error( FUNCTION_NAME, "%s", _( "scalar images only" ) );
return -1;
}
if( 1 != im-> Bands ){
im_error( FUNCTION_NAME, _( "single band images only" ) );
im_error( FUNCTION_NAME, "%s", _( "single band images only" ) );
return -1;
}
if( IM_CODING_NONE != im-> Coding ){
im_error( FUNCTION_NAME, _( "uncoded images only" ) );
im_error( FUNCTION_NAME, "%s", _( "uncoded images only" ) );
return -1;
}
if( ! xpos || ! ypos || ! minima || n < 1 ){
im_error( FUNCTION_NAME, _( "invalid argument" ) );
im_error( FUNCTION_NAME, "%s", _( "invalid argument" ) );
return -1;
}

View File

@ -186,11 +186,11 @@ im_measure( IMAGE *im, IMAGE_BOX *box, int h, int v,
}
if( im->Coding != IM_CODING_NONE ) {
im_error( "im_measure", _( "not uncoded" ) );
im_error( "im_measure", "%s", _( "not uncoded" ) );
return( NULL );
}
if( im_iscomplex( im ) ) {
im_error( "im_measure", _( "bad input type" ) );
im_error( "im_measure", "%s", _( "bad input type" ) );
return( NULL );
}

View File

@ -233,7 +233,7 @@ im_min( IMAGE *in, double *out )
if( im_pincheck( in ) )
return( -1 );
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_min", _( "not uncoded" ) );
im_error( "im_min", "%s", _( "not uncoded" ) );
return( -1 );
}

View File

@ -77,7 +77,7 @@ im_minpos( IMAGE *in, int *xpos, int *ypos, double *out )
return( -1 );
if( in->Coding != IM_CODING_NONE )
{
im_error("im_minpos", _("input must be uncoded"));
im_error("im_minpos", "%s", _("input must be uncoded"));
return( -1 );
}

View File

@ -190,16 +190,17 @@ im_multiply( IMAGE *in1, IMAGE *in2, IMAGE *out )
return( -1 );
if( in1->Xsize != in2->Xsize || in1->Ysize != in2->Ysize ) {
im_error( "im_multiply", _( "not same size" ) );
im_error( "im_multiply", "%s", _( "not same size" ) );
return( -1 );
}
if( in1->Bands != in2->Bands &&
(in1->Bands != 1 && in2->Bands != 1) ) {
im_error( "im_multiply", _( "not same number of bands" ) );
im_error( "im_multiply",
"%s", _( "not same number of bands" ) );
return( -1 );
}
if( in1->Coding != IM_CODING_NONE || in2->Coding != IM_CODING_NONE ) {
im_error( "im_multiply", _( "not uncoded" ) );
im_error( "im_multiply", "%s", _( "not uncoded" ) );
return( -1 );
}
if( im_cp_descv( out, in1, in2, NULL ) )

View File

@ -72,19 +72,19 @@ int im_point_bilinear( IMAGE *im, double x, double y, int band, double *val ){
return -1;
if( im-> Coding ){
im_error( FUNCTION_NAME, _("uncoded images only") );
im_error( FUNCTION_NAME, "%s", _("uncoded images only") );
return -1;
}
if( !( im_isint( im ) || im_isfloat( im ) ) ){
im_error( FUNCTION_NAME, _("scalar images only") );
im_error( FUNCTION_NAME, "%s", _("scalar images only") );
return -1;
}
if( band >= im-> Bands || x < 0.0 || y < 0.0 || x > im-> Xsize || y > im-> Ysize ){
im_error( FUNCTION_NAME, _("coords outside image") );
im_error( FUNCTION_NAME, "%s", _("coords outside image") );
return -1;
}
if( ! val ){
im_error( FUNCTION_NAME, _("invalid arguments") );
im_error( FUNCTION_NAME, "%s", _("invalid arguments") );
return -1;
}
@ -94,7 +94,7 @@ int im_point_bilinear( IMAGE *im, double x, double y, int band, double *val ){
return -1;
if( ! im_rect_includesrect( &reg-> valid, &need ) ){
im_error( FUNCTION_NAME, _("coords outside image") );
im_error( FUNCTION_NAME, "%s", _("coords outside image") );
im_region_free( reg );
return -1;
}

View File

@ -181,11 +181,11 @@ im_powtra_vec( IMAGE *in, IMAGE *out, int n, double *e )
/* Check args.
*/
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_powtra_vec", _( "not uncoded" ) );
im_error( "im_powtra_vec", "%s", _( "not uncoded" ) );
return( -1 );
}
if( im_iscomplex( in ) ) {
im_error( "im_powtra_vec", _( "not non-complex" ) );
im_error( "im_powtra_vec", "%s", _( "not non-complex" ) );
return( -1 );
}
if( n != 1 && n != in->Bands ) {

View File

@ -95,16 +95,17 @@ im_remainder( IMAGE *in1, IMAGE *in2, IMAGE *out )
if( im_piocheck( in1, out ) || im_pincheck( in2 ) )
return( -1 );
if( in1->Xsize != in2->Xsize || in1->Ysize != in2->Ysize ) {
im_error( "im_remainder", _( "not same size" ) );
im_error( "im_remainder", "%s", _( "not same size" ) );
return( -1 );
}
if( in1->Bands != in2->Bands &&
(in1->Bands != 1 && in2->Bands != 1) ) {
im_error( "im_remainder", _( "not same number of bands" ) );
im_error( "im_remainder",
"%s", _( "not same number of bands" ) );
return( -1 );
}
if( in1->Coding != IM_CODING_NONE || in2->Coding != IM_CODING_NONE ) {
im_error( "im_remainder", _( "not uncoded" ) );
im_error( "im_remainder", "%s", _( "not uncoded" ) );
return( -1 );
}
if( im_cp_descv( out, in1, in2, NULL ) )
@ -210,7 +211,7 @@ im_remainderconst_vec( IMAGE *in, IMAGE *out, int n, double *c )
if( im_piocheck( in, out ) )
return( -1 );
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_remainderconst_vec", _( "not uncoded" ) );
im_error( "im_remainderconst_vec", "%s", _( "not uncoded" ) );
return( -1 );
}
if( n != 1 && n != in->Bands ) {
@ -237,7 +238,7 @@ im_remainderconst_vec( IMAGE *in, IMAGE *out, int n, double *c )
if( rc->c[i] == 0 ) {
im_error( "im_remainderconst_vec",
_( "division by zero" ) );
"%s", _( "division by zero" ) );
return( -1 );
}
}

View File

@ -89,7 +89,7 @@ im_rint( IMAGE *in, IMAGE *out )
/* Check args.
*/
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_rint", _( "not uncoded" ) );
im_error( "im_rint", "%s", _( "not uncoded" ) );
return( -1 );
}

View File

@ -143,7 +143,7 @@ int
im_sign( IMAGE *in, IMAGE *out )
{
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_sign", _( "not uncoded" ) );
im_error( "im_sign", "%s", _( "not uncoded" ) );
return( -1 );
}
if( im_cp_desc( out, in ) )

View File

@ -114,11 +114,11 @@ im_sintra( IMAGE *in, IMAGE *out )
if( im_piocheck( in, out ) )
return( -1 );
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_sintra", _( "not uncoded" ) );
im_error( "im_sintra", "%s", _( "not uncoded" ) );
return( -1 );
}
if( im_iscomplex( in ) ) {
im_error( "im_sintra", _( "not non-complex" ) );
im_error( "im_sintra", "%s", _( "not non-complex" ) );
return( -1 );
}
@ -199,11 +199,11 @@ im_asintra( IMAGE *in, IMAGE *out )
if( im_piocheck( in, out ) )
return( -1 );
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_asintra", _( "not uncoded" ) );
im_error( "im_asintra", "%s", _( "not uncoded" ) );
return( -1 );
}
if( im_iscomplex( in ) ) {
im_error( "im_asintra", _( "not non-complex" ) );
im_error( "im_asintra", "%s", _( "not non-complex" ) );
return( -1 );
}

View File

@ -234,11 +234,11 @@ im_stats( IMAGE *in )
if( im_pincheck( in ) )
return( NULL );
if( im_iscomplex( in ) ) {
im_error( "im_stats", _( "bad input type" ) );
im_error( "im_stats", "%s", _( "bad input type" ) );
return( NULL );
}
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_stats", _( "not uncoded" ) );
im_error( "im_stats", "%s", _( "not uncoded" ) );
return( NULL );
}

View File

@ -179,11 +179,12 @@ im_subtract( IMAGE *in1, IMAGE *in2, IMAGE *out )
return( -1 );
if( in1->Bands != in2->Bands &&
(in1->Bands != 1 && in2->Bands != 1) ) {
im_error( "im_subtract", _( "not same number of bands" ) );
im_error( "im_subtract",
"%s", _( "not same number of bands" ) );
return( -1 );
}
if( in1->Coding != IM_CODING_NONE || in2->Coding != IM_CODING_NONE ) {
im_error( "im_subtract", _( "not uncoded" ) );
im_error( "im_subtract", "%s", _( "not uncoded" ) );
return( -1 );
}
if( im_cp_descv( out, in1, in2, NULL ) )

View File

@ -114,11 +114,11 @@ im_tantra( IMAGE *in, IMAGE *out )
if( im_piocheck( in, out ) )
return( -1 );
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_tantra", _( "not uncoded" ) );
im_error( "im_tantra", "%s", _( "not uncoded" ) );
return( -1 );
}
if( im_iscomplex( in ) ) {
im_error( "im_tantra", _( "not non-complex" ) );
im_error( "im_tantra", "%s", _( "not non-complex" ) );
return( -1 );
}
@ -200,11 +200,11 @@ im_atantra( IMAGE *in, IMAGE *out )
if( im_piocheck( in, out ) )
return( -1 );
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_atantra", _( "not uncoded" ) );
im_error( "im_atantra", "%s", _( "not uncoded" ) );
return( -1 );
}
if( im_iscomplex( in ) ) {
im_error( "im_atantra", _( "not non-complex" ) );
im_error( "im_atantra", "%s", _( "not non-complex" ) );
return( -1 );
}

View File

@ -171,7 +171,7 @@ greyc_gen( REGION *out, REGION **in, IMAGE **arry, Greyc *greyc )
if( msk )
delete( msk );
im_error( "GREYCstoration", e.message );
im_error( "GREYCstoration", "%s", e.message );
return( -1 );
}
@ -203,22 +203,23 @@ im_greyc_mask( IMAGE *in, IMAGE *out, IMAGE *mask,
if( im_piocheck( in, out ) )
return( -1 );
if( in->Coding != IM_CODING_NONE ) {
im_error( "GREYCstoration", _( "uncoded only" ) );
im_error( "GREYCstoration", "%s", _( "uncoded only" ) );
return( -1 );
}
if( mask ) {
if( mask->Coding != IM_CODING_NONE ) {
im_error( "GREYCstoration", _( "uncoded only" ) );
im_error( "GREYCstoration", "%s", _( "uncoded only" ) );
return( -1 );
}
if( mask->Xsize != in->Xsize ||
mask->Ysize != in->Ysize ) {
im_error( "GREYCstoration",
_( "mask size does not match input" ) );
"%s", _( "mask size does not match input" ) );
return( -1 );
}
if( mask->BandFmt != IM_BANDFMT_UCHAR ) {
im_error( "GREYCstoration", _( "mask must be uchar" ) );
im_error( "GREYCstoration",
"%s", _( "mask must be uchar" ) );
return( -1 );
}
}
@ -278,7 +279,8 @@ im_greyc_mask( IMAGE *in, IMAGE *out, IMAGE *mask,
default:
im_error( "GREYCstoration",
_( "unsupported type: uchar, ushort and float only" ) );
"%s", _( "unsupported type: "
"uchar, ushort and float only" ) );
return( -1 );
}

View File

@ -118,7 +118,7 @@ im_Lab2XYZ_temp( IMAGE *in, IMAGE *out, double X0, double Y0, double Z0 )
if( in->Bands != 3 ||
in->BandFmt != IM_BANDFMT_FLOAT ||
in->Coding != IM_CODING_NONE ) {
im_error( "im_Lab2XYZ", _( "not 3-band uncoded float" ) );
im_error( "im_Lab2XYZ", "%s", _( "not 3-band uncoded float" ) );
return( -1 );
}

View File

@ -160,7 +160,7 @@ im_XYZ2Lab_temp( IMAGE *in, IMAGE *out,
if( in->Bands != 3 ||
in->BandFmt != IM_BANDFMT_FLOAT ||
in->Coding != IM_CODING_NONE ) {
im_error( "im_XYZ2Lab", _( "not 3-band uncoded float" ) );
im_error( "im_XYZ2Lab", "%s", _( "not 3-band uncoded float" ) );
return( -1 );
}

View File

@ -139,7 +139,8 @@ im_XYZ2disp( IMAGE *in, IMAGE *out, struct im_col_display *d )
*/
if( in->Bands != 3 || in->BandFmt != IM_BANDFMT_FLOAT ||
in->Coding != IM_CODING_NONE ) {
im_error( "im_XYZ2disp", _( "3-band uncoded float only" ) );
im_error( "im_XYZ2disp",
"%s", _( "3-band uncoded float only" ) );
return( -1 );
}

View File

@ -89,7 +89,8 @@ im_disp2XYZ( IMAGE *in, IMAGE *out, struct im_col_display *d )
*/
if( in->Bands != 3 || in->BandFmt != IM_BANDFMT_UCHAR ||
in->Coding != IM_CODING_NONE ) {
im_error( "im_disp2XYZ", _( "input not 3-band uncoded char" ) );
im_error( "im_disp2XYZ",
"%s", _( "input not 3-band uncoded char" ) );
return( -1 );
}

View File

@ -251,7 +251,7 @@ icc_new_file( IMAGE *in, IMAGE *out,
if( !icc->in_profile || !icc->out_profile ) {
im_error( "im_icc_transform",
_( "unable to create profiles" ) );
"%s", _( "unable to create profiles" ) );
return( NULL );
}
@ -269,7 +269,8 @@ icc_new_mem( IMAGE *in, IMAGE *out,
return( NULL );
if( !(icc->in_profile = cmsOpenProfileFromMem( data, data_length )) ) {
im_error( "im_icc_transform", _( "unable to read profile" ) );
im_error( "im_icc_transform",
"%s", _( "unable to read profile" ) );
return( NULL );
}
icc->out_profile = cmsCreateLabProfile( NULL );
@ -382,7 +383,7 @@ im_icc_transform( IMAGE *in, IMAGE *out,
DWORD out_icc_format;
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_icc_transform", _( "uncoded input only" ) );
im_error( "im_icc_transform", "%s", _( "uncoded input only" ) );
return( -1 );
}
@ -409,7 +410,8 @@ im_icc_transform( IMAGE *in, IMAGE *out,
switch( cmsGetColorSpace( icc->in_profile ) ) {
case icSigCmykData:
if( in->Bands != 4 ) {
im_error( "im_icc_transform", _( "CMYK input profile "
im_error( "im_icc_transform",
"%s", _( "CMYK input profile "
"needs a 4 band input image" ) );
return( -1 );
}
@ -418,7 +420,8 @@ im_icc_transform( IMAGE *in, IMAGE *out,
case icSigRgbData:
if( in->Bands != 3 ) {
im_error( "im_icc_transform", _( "RGB input profile "
im_error( "im_icc_transform",
"%s", _( "RGB input profile "
"needs a 3 band input image" ) );
return( -1 );
}
@ -470,7 +473,7 @@ im_icc_transform( IMAGE *in, IMAGE *out,
default:
im_error( "im_icc_transform",
_( "uchar or ushort input only" ) );
"%s", _( "uchar or ushort input only" ) );
return( -1 );
}
@ -517,7 +520,7 @@ icc_import( IMAGE *in, IMAGE *out, Icc *icc )
DWORD icc_format;
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_icc_import", _( "uncoded input only" ) );
im_error( "im_icc_import", "%s", _( "uncoded input only" ) );
return( -1 );
}
@ -540,7 +543,8 @@ icc_import( IMAGE *in, IMAGE *out, Icc *icc )
switch( cmsGetColorSpace( icc->in_profile ) ) {
case icSigCmykData:
if( in->Bands != 4 ) {
im_error( "im_icc_import", _( "CMYK profile needs a "
im_error( "im_icc_import",
"%s", _( "CMYK profile needs a "
"4 band input image" ) );
return( -1 );
}
@ -549,7 +553,8 @@ icc_import( IMAGE *in, IMAGE *out, Icc *icc )
case icSigRgbData:
if( in->Bands != 3 ) {
im_error( "im_icc_import", _( "RGB profile needs a "
im_error( "im_icc_import",
"%s", _( "RGB profile needs a "
"3 band input image" ) );
return( -1 );
}
@ -573,7 +578,7 @@ icc_import( IMAGE *in, IMAGE *out, Icc *icc )
default:
im_error( "im_icc_transform",
_( "uchar or ushort input only" ) );
"%s", _( "uchar or ushort input only" ) );
return( -1 );
}
@ -612,7 +617,7 @@ im_icc_import_embedded( IMAGE *in, IMAGE *out, int intent )
if( im_header_get_type( in, IM_META_ICC_NAME ) == 0 ) {
im_error( "im_icc_import_embedded",
_( "no embedded profile" ) );
"%s", _( "no embedded profile" ) );
return( -1 );
}
@ -668,12 +673,12 @@ im_icc_export_depth( IMAGE *in, IMAGE *out, int depth,
if( in->Bands != 3 || in->BandFmt != IM_BANDFMT_FLOAT ||
in->Coding != IM_CODING_NONE ) {
im_error( "im_icc_export",
_( "3-band uncoded Lab float only" ) );
"%s", _( "3-band uncoded Lab float only" ) );
return( -1 );
}
if( depth != 8 && depth != 16 ) {
im_error( "im_icc_export", _( "unsupported bit depth" ) );
im_error( "im_icc_export", "%s", _( "unsupported bit depth" ) );
return( -1 );
}
@ -758,7 +763,7 @@ im_icc_ac2rc( IMAGE *in, IMAGE *out, const char *profile_filename )
return( -1 );
if( !cmsTakeMediaWhitePoint( &media, profile ) ) {
im_error( "im_icc_ac2rc", _( "unable to get media "
im_error( "im_icc_ac2rc", "%s", _( "unable to get media "
"white point" ) );
return( -1 );
}

View File

@ -438,11 +438,11 @@ im_clip2fmt( IMAGE *in, IMAGE *out, int ofmt )
if( im_piocheck( in, out ) )
return( -1 );
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_clip2fmt", _( "in must be uncoded" ) );
im_error( "im_clip2fmt", "%s", _( "in must be uncoded" ) );
return( -1 );
}
if( ofmt < 0 || ofmt > IM_BANDFMT_DPCOMPLEX ) {
im_error( "im_clip2fmt", _( "ofmt out of range" ) );
im_error( "im_clip2fmt", "%s", _( "ofmt out of range" ) );
return( -1 );
}

View File

@ -131,11 +131,11 @@ im_copy_set_all( IMAGE *in, IMAGE *out,
if( im_piocheck( in, out ) )
return( -1 );
if( in->Coding != IM_CODING_NONE && in->Coding != IM_CODING_LABQ ) {
im_error( "im_copy", _( "in must be uncoded" ) );
im_error( "im_copy", "%s", _( "in must be uncoded" ) );
return( -1 );
}
if( Coding != IM_CODING_NONE && Coding != IM_CODING_LABQ ) {
im_error( "im_copy", _( "Coding must be NONE or LABQ" ) );
im_error( "im_copy", "%s", _( "Coding must be NONE or LABQ" ) );
return( -1 );
}
if( BandFmt < 0 || BandFmt > IM_BANDFMT_DPCOMPLEX ) {
@ -162,7 +162,7 @@ im_copy_set_all( IMAGE *in, IMAGE *out,
* changed Bands and BandFmt ... bad!
*/
if( IM_IMAGE_SIZEOF_PEL( in ) != IM_IMAGE_SIZEOF_PEL( out ) ) {
im_error( "im_copy", _( "sizeof( pixel ) has changed" ) );
im_error( "im_copy", "%s", _( "sizeof( pixel ) has changed" ) );
return( -1 );
}
@ -278,7 +278,7 @@ im_copy_swap( IMAGE *in, IMAGE *out )
if( im_piocheck( in, out ) )
return( -1 );
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_copy_swap", _( "in must be uncoded" ) );
im_error( "im_copy_swap", "%s", _( "in must be uncoded" ) );
return( -1 );
}
if( im_cp_desc( out, in ) )
@ -315,7 +315,7 @@ im_copy_swap( IMAGE *in, IMAGE *out )
break;
default:
im_error( "im_copy_swap", _( "unsupported image type" ) );
im_error( "im_copy_swap", "%s", _( "unsupported image type" ) );
return( -1 );
}

View File

@ -163,20 +163,21 @@ im_extract_areabands( IMAGE *in, IMAGE *out,
return( -1 );
if( band < 0 || nbands < 1 || band + nbands > in->Bands ) {
im_error( "im_extract_areabands",
_( "band selection out of range" ) );
"%s", _( "band selection out of range" ) );
return( -1 );
}
if( left + width > in->Xsize ||
top + height > in->Ysize ||
left < 0 || top < 0 ||
width <= 0 || height <= 0 ) {
im_error( "im_extract_areabands", _( "bad extract area" ) );
im_error( "im_extract_areabands",
"%s", _( "bad extract area" ) );
return( -1 );
}
if( in->Coding != IM_CODING_NONE ) {
if( in->Coding != IM_CODING_LABQ ) {
im_error( "im_extract_areabands",
_( "unknown coding" ) );
"%s", _( "unknown coding" ) );
return( -1 );
}
@ -184,7 +185,7 @@ im_extract_areabands( IMAGE *in, IMAGE *out,
*/
if( band != 0 || nbands != in->Bands ) {
im_error( "im_extract_areabands",
_( "can only extract areas from LABQ" ) );
"%s", _( "can only extract areas from LABQ" ) );
return( -1 );
}
}

View File

@ -336,8 +336,8 @@ im_falsecolour( IMAGE *in, IMAGE *out )
return( -1 );
if( in->Bands != 1 || in->Coding != IM_CODING_NONE ||
in->BandFmt != IM_BANDFMT_UCHAR ) {
im_error( "im_falsecolour", _( "input image not one band "
"uchar uncoded" ) );
im_error( "im_falsecolour",
"%s", _( "input image not one band uchar uncoded" ) );
return( -1 );
}

View File

@ -125,7 +125,7 @@ im_fliphor( IMAGE *in, IMAGE *out )
if( im_piocheck( in, out ) )
return( -1 );
if( in->Coding != IM_CODING_NONE && in->Coding != IM_CODING_LABQ ) {
im_error( "im_fliphor", _( "in must be uncoded" ) );
im_error( "im_fliphor", "%s", _( "in must be uncoded" ) );
return( -1 );
}

View File

@ -172,7 +172,7 @@ im_gbandjoin( IMAGE **in, IMAGE *out, int nim )
/* Check it out!
*/
if( nim < 1 ) {
im_error( "im_gbandjoin", _( "zero input images!" ) );
im_error( "im_gbandjoin", "%s", _( "zero input images!" ) );
return( -1 );
}
if( nim == 1 )
@ -187,19 +187,20 @@ im_gbandjoin( IMAGE **in, IMAGE *out, int nim )
return( -1 );
if( in[i]->Coding != IM_CODING_NONE ) {
im_error( "im_gbandjoin", _( "uncoded input only" ) );
im_error( "im_gbandjoin",
"%s", _( "uncoded input only" ) );
return( -1 );
}
if( in[0]->BandFmt != in[i]->BandFmt ) {
im_error( "im_gbandjoin",
_( "input images differ in format" ) );
"%s", _( "input images differ in format" ) );
return( -1 );
}
if( in[0]->Xsize != in[i]->Xsize ||
in[0]->Ysize != in[i]->Ysize ) {
im_error( "im_gbandjoin",
_( "input images differ in size" ) );
"%s", _( "input images differ in size" ) );
return( -1 );
}
}

View File

@ -148,12 +148,12 @@ im_grid( IMAGE *in, IMAGE *out, int tile_height, int across, int down )
if( !grid || im_piocheck( in, out ) )
return( -1 );
if( across <= 0 || down <= 0 ) {
im_error( "im_grid", _( "bad parameters" ) );
im_error( "im_grid", "%s", _( "bad parameters" ) );
return( -1 );
}
if( in->Ysize % tile_height != 0 ||
in->Ysize / tile_height != across * down ) {
im_error( "im_grid", _( "bad grid geometry" ) );
im_error( "im_grid", "%s", _( "bad grid geometry" ) );
return( -1 );
}

View File

@ -231,16 +231,16 @@ im_insert( IMAGE *main, IMAGE *sub, IMAGE *out, int x, int y )
return( -1 );
if( main->BandFmt != sub->BandFmt || main->Bands != sub->Bands ||
main->Coding != sub->Coding ) {
im_error( "im_insert", _( "inputs differ in format" ) );
im_error( "im_insert", "%s", _( "inputs differ in format" ) );
return( -1 );
}
if( main->Coding != IM_CODING_NONE && main->Coding != IM_CODING_LABQ ) {
im_error( "im_insert",
im_error( "im_insert", "%s",
_( "input should be uncoded or IM_CODING_LABQ" ) );
return( -1 );
}
if( x > RANGE || x < -RANGE || y > RANGE || y < -RANGE ) {
im_error( "im_insert", _( "xy out of range" ) );
im_error( "im_insert", "%s", _( "xy out of range" ) );
return( -1 );
}
@ -321,16 +321,16 @@ im_insert_noexpand( IMAGE *main, IMAGE *sub, IMAGE *out, int x, int y )
if( main->BandFmt != sub->BandFmt || main->Bands != sub->Bands ||
main->Coding != sub->Coding ) {
im_error( "im_insert_noexpand",
_( "inputs differ in format" ) );
"%s", _( "inputs differ in format" ) );
return( -1 );
}
if( main->Coding != IM_CODING_NONE && main->Coding != IM_CODING_LABQ ) {
im_error( "im_insert_noexpand",
im_error( "im_insert_noexpand", "%s",
_( "input should be uncoded or IM_CODING_LABQ" ) );
return( -1 );
}
if( x > RANGE || x < -RANGE || y > RANGE || y < -RANGE ) {
im_error( "im_insert", _( "xy out of range" ) );
im_error( "im_insert", "%s", _( "xy out of range" ) );
return( -1 );
}

View File

@ -140,7 +140,7 @@ im_msb (IMAGE * in, IMAGE * out)
if (!IM_ANY_INT (in))
{
im_error (FUNCTION_NAME, _("char, short or int only"));
im_error (FUNCTION_NAME, "%s", _("char, short or int only"));
return -1;
}
@ -176,7 +176,7 @@ im_msb (IMAGE * in, IMAGE * out)
else
{
im_error (FUNCTION_NAME, _("unknown coding"));
im_error (FUNCTION_NAME, "%s", _("unknown coding"));
return -1;
}
@ -210,7 +210,7 @@ im_msb_band (IMAGE * in, IMAGE * out, int band)
if (band < 0)
{
im_error (FUNCTION_NAME, _("bad arguments"));
im_error (FUNCTION_NAME, "%s", _("bad arguments"));
return -1;
}
@ -227,13 +227,14 @@ im_msb_band (IMAGE * in, IMAGE * out, int band)
if (!IM_ANY_INT (in))
{
im_error (FUNCTION_NAME, _("char, short or int only"));
im_error (FUNCTION_NAME, "%s", _("char, short or int only"));
return -1;
}
if (band >= in->Bands)
{
im_error (FUNCTION_NAME, _("image does not have that many bands"));
im_error (FUNCTION_NAME,
"%s", _("image does not have that many bands"));
return -1;
}
@ -259,7 +260,8 @@ im_msb_band (IMAGE * in, IMAGE * out, int band)
if (band > 2)
{
im_error (FUNCTION_NAME, _("image does not have that many bands"));
im_error (FUNCTION_NAME,
"%s", _("image does not have that many bands"));
return -1;
}
width = 4;
@ -273,7 +275,7 @@ im_msb_band (IMAGE * in, IMAGE * out, int band)
}
else
{
im_error (FUNCTION_NAME, _("unknown coding"));
im_error (FUNCTION_NAME, "%s", _("unknown coding"));
return -1;
}

View File

@ -111,34 +111,34 @@ im_rightshift_size( IMAGE *in, IMAGE *out, int xshift, int yshift, int band_fmt
return -1;
if( xshift < 0 || yshift < 0 ){
im_error( FUNCTION_NAME, _( "bad arguments" ) );
im_error( FUNCTION_NAME, "%s", _( "bad arguments" ) );
return -1;
}
if( ! xshift && ! yshift ){
im_warn( FUNCTION_NAME, _( "shift by zero: falling back to im_copy" ) );
im_warn( FUNCTION_NAME, "%s", _( "shift by zero: falling back to im_copy" ) );
return im_copy( in, out );
}
if( ! in-> Xsize >> xshift || ! in-> Ysize >> yshift ){
im_error( FUNCTION_NAME, _( "would result in zero size output image" ) );
im_error( FUNCTION_NAME, "%s", _( "would result in zero size output image" ) );
return -1;
}
if( ! im_isint( in ) ){
im_error( FUNCTION_NAME, _( "integer type images only" ) );
im_error( FUNCTION_NAME, "%s", _( "integer type images only" ) );
return -1;
}
if( IM_CODING_NONE != in->Coding ){
im_error( FUNCTION_NAME, _( "uncoded images only" ) );
im_error( FUNCTION_NAME, "%s", _( "uncoded images only" ) );
return -1;
}
if( im_isuint( in ) ){
if( IM_BANDFMT_UCHAR != band_fmt && IM_BANDFMT_USHORT != band_fmt && IM_BANDFMT_UINT != band_fmt ){
im_error( FUNCTION_NAME, _( "unsigned input means that output must be unsigned int, short or char" ) );
im_error( FUNCTION_NAME, "%s", _( "unsigned input means that output must be unsigned int, short or char" ) );
return -1;
}
}
else {
if( IM_BANDFMT_CHAR != band_fmt && IM_BANDFMT_SHORT != band_fmt && IM_BANDFMT_INT != band_fmt ){
im_error( FUNCTION_NAME, _( "signed input means that output must be signed int, short or char" ) );
im_error( FUNCTION_NAME, "%s", _( "signed input means that output must be signed int, short or char" ) );
return -1;
}
}

View File

@ -136,7 +136,8 @@ im_rot180( IMAGE *in, IMAGE *out )
if( im_piocheck( in, out ) )
return( -1 );
if( in->Coding != IM_CODING_NONE && in->Coding != IM_CODING_LABQ ) {
im_error( "im_rot180", _( "uncoded or IM_CODING_LABQ only" ) );
im_error( "im_rot180",
"%s", _( "uncoded or IM_CODING_LABQ only" ) );
return( -1 );
}
if( im_cp_desc( out, in ) )

View File

@ -138,7 +138,8 @@ im_rot270( IMAGE *in, IMAGE *out )
if( im_piocheck( in, out ) )
return( -1 );
if( in->Coding != IM_CODING_NONE && in->Coding != IM_CODING_LABQ ) {
im_error( "im_rot270", _( "uncoded or IM_CODING_LABQ only" ) );
im_error( "im_rot270",
"%s", _( "uncoded or IM_CODING_LABQ only" ) );
return( -1 );
}
if( im_cp_desc( out, in ) )

View File

@ -138,7 +138,8 @@ im_rot90( IMAGE *in, IMAGE *out )
if( im_piocheck( in, out ) )
return( -1 );
if( in->Coding != IM_CODING_NONE && in->Coding != IM_CODING_LABQ ) {
im_error( "im_rot90", _( "uncoded or IM_CODING_LABQ only" ) );
im_error( "im_rot90",
"%s", _( "uncoded or IM_CODING_LABQ only" ) );
return( -1 );
}
if( im_cp_desc( out, in ) )

View File

@ -195,7 +195,8 @@ im_subsample( IMAGE *in, IMAGE *out, int xshrink, int yshrink )
/* Check parameters.
*/
if( xshrink < 1 || yshrink < 1 ) {
im_error( "im_subsample", _( "factors should both be >= 1" ) );
im_error( "im_subsample",
"%s", _( "factors should both be >= 1" ) );
return( -1 );
}
if( xshrink == 1 && yshrink == 1 )
@ -212,7 +213,8 @@ im_subsample( IMAGE *in, IMAGE *out, int xshrink, int yshrink )
out->Xres = in->Xres / xshrink;
out->Yres = in->Yres / yshrink;
if( out->Xsize <= 0 || out->Ysize <= 0 ) {
im_error( "im_subsample", _( "image has shrunk to nothing" ) );
im_error( "im_subsample",
"%s", _( "image has shrunk to nothing" ) );
return( -1 );
}

View File

@ -142,7 +142,8 @@ text_layout_render_to_image( PangoLayout *layout, IMAGE *out )
/* Can happen for "", for example.
*/
if( width == 0 || height == 0 ) {
im_error( "im_text", _( "no text to render" ) );
im_error( "im_text",
"%s", _( "no text to render" ) );
return( -1 );
}
@ -197,7 +198,8 @@ im_text( IMAGE *out, const char *text, const char *font,
PangoContext *context;
if( !pango_parse_markup( text, -1, 0, NULL, NULL, NULL, NULL ) ) {
im_error( "im_text", _( "invalid markup in text" ) );
im_error( "im_text",
"%s", _( "invalid markup in text" ) );
return( -1 );
}
@ -229,7 +231,8 @@ int
im_text( IMAGE *out, const char *text, const char *font,
int width, int alignment, int dpi )
{
im_error( "im_text", _( "pangoft2 support disabled" ) );
im_error( "im_text",
"%s", _( "pangoft2 support disabled" ) );
return( -1 );
}

View File

@ -83,7 +83,7 @@ im_vips2mask( IMAGE *in, const char *outname )
if( im_incheck( in ) )
return( NULL );
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_vips2mask", _( "uncoded images only" ) );
im_error( "im_vips2mask", "%s", _( "uncoded images only" ) );
return( NULL );
}
if( in->Bands == 1 ) {
@ -100,7 +100,7 @@ im_vips2mask( IMAGE *in, const char *outname )
}
else {
im_error( "im_vips2mask",
_( "one band, nx1, or 1xn images only" ) );
"%s", _( "one band, nx1, or 1xn images only" ) );
return( NULL );
}

View File

@ -54,7 +54,7 @@
/*
* TODO:
* Test for pixel size and use memcpy() on individual pixels once they reach
* sizes of the order of tens of bytes. char-wise copy is quiker than
* sizes of the order of tens of bytes. char-wise copy is quicker than
* memcpy() for smaller pixels.
*
* Also, I haven't tested it but int-wise copying may be faster still, as
@ -124,7 +124,7 @@ paint_whole( REGION *or, REGION *ir, ZoomInfo *zm,
/* We know this!
*/
assert( right > left && bottom > top &&
g_assert( right > left && bottom > top &&
right % zm->xfac == 0 &&
left % zm->xfac == 0 &&
top % zm->yfac == 0 &&
@ -190,7 +190,7 @@ paint_part( REGION *or, REGION *ir, const ZoomInfo *zm,
/* Only know this.
*/
assert( right - left >= 0 && bottom - top >= 0 );
g_assert( right - left >= 0 && bottom - top >= 0 );
/* Have to loop over output.
*/
@ -325,18 +325,18 @@ im_zoom( IMAGE *in, IMAGE *out, int xfac, int yfac )
/* Check arguments.
*/
if( in->Coding != IM_CODING_NONE && in->Coding != IM_CODING_LABQ ) {
im_error( "im_zoom", _( "unknown coding type" ) );
im_error( "im_zoom", "%s", _( "unknown coding type" ) );
return( -1 );
}
if( xfac <= 0 || yfac <= 0 ) {
im_error( "im_zoom", _( "zoom factors should be >= 0" ) );
im_error( "im_zoom", "%s", _( "zoom factors should be >= 0" ) );
return( -1 );
}
if( (double) in->Xsize * xfac > (double) INT_MAX / 2 ||
(double) in->Ysize * yfac > (double) INT_MAX / 2 ) {
/* Make sure we won't get integer overflow.
*/
im_error( "im_zoom", _( "zoom factors too large" ) );
im_error( "im_zoom", "%s", _( "zoom factors too large" ) );
return( -1 );
}
if( xfac == 1 && yfac == 1 )
@ -359,7 +359,7 @@ im_zoom( IMAGE *in, IMAGE *out, int xfac, int yfac )
zm->yfac = yfac;
/* Set demand hints. THINSTRIP will prevent us from using
* paint_whole() too much ... so go for FATSTRIP.
* paint_whole() much ... so go for FATSTRIP.
*/
if( im_demand_hint( out, IM_FATSTRIP, in, NULL ) )
return( -1 );

View File

@ -144,20 +144,20 @@ im_contrast_surface_raw (IMAGE * in, IMAGE * out, int half_win_size,
if (IM_CODING_NONE != in->Coding || IM_BANDFMT_UCHAR != in->BandFmt
|| 1 != in->Bands)
{
im_error (FUNCTION_NAME, _("one band uncoded uchar only"));
im_error (FUNCTION_NAME, "%s", _("one band uncoded uchar only"));
return -1;
}
if (half_win_size < 1 || spacing < 1)
{
im_error (FUNCTION_NAME, _("bad parameters"));
im_error (FUNCTION_NAME, "%s", _("bad parameters"));
return -1;
}
if (DOUBLE (half_win_size) >= LESSER (in->Xsize, in->Ysize))
{
im_error (FUNCTION_NAME,
_("parameters would result in zero size output image"));
"%s", _("parameters would result in zero size output image"));
return -1;
}

View File

@ -286,13 +286,13 @@ im_convf_raw( IMAGE *in, IMAGE *out, DOUBLEMASK *mask )
*/
if( !in || in->Coding != IM_CODING_NONE || im_iscomplex( in ) ) {
im_error( "im_convf",
_( "non-complex uncoded only" ) );
"%s", _( "non-complex uncoded only" ) );
return( -1 );
}
if( !mask || mask->xsize > 1000 || mask->ysize > 1000 ||
mask->xsize <= 0 || mask->ysize <= 0 || !mask->coeff ||
mask->scale == 0 ) {
im_error( "im_convf", _( "nonsense mask parameters" ) );
im_error( "im_convf", "%s", _( "nonsense mask parameters" ) );
return( -1 );
}
if( im_piocheck( in, out ) )
@ -312,7 +312,7 @@ im_convf_raw( IMAGE *in, IMAGE *out, DOUBLEMASK *mask )
out->Xsize -= mask->xsize - 1;
out->Ysize -= mask->ysize - 1;
if( out->Xsize <= 0 || out->Ysize <= 0 ) {
im_error( "im_convf", _( "image too small for mask" ) );
im_error( "im_convf", "%s", _( "image too small for mask" ) );
return( -1 );
}

View File

@ -380,17 +380,18 @@ im_convsep_raw( IMAGE *in, IMAGE *out, INTMASK *mask )
/* Check parameters.
*/
if( !in || in->Coding != IM_CODING_NONE || im_iscomplex( in ) ) {
im_error( "im_convsep", _( "non-complex uncoded only" ) );
im_error( "im_convsep", "%s", _( "non-complex uncoded only" ) );
return( -1 );
}
if( !mask || mask->xsize > 1000 || mask->ysize > 1000 ||
mask->xsize <= 0 || mask->ysize <= 0 || !mask->coeff ||
mask->scale == 0 ) {
im_error( "im_convsep", _( "nonsense mask parameters" ) );
im_error( "im_convsep", "%s", _( "nonsense mask parameters" ) );
return( -1 );
}
if( mask->xsize != 1 && mask->ysize != 1 ) {
im_error( "im_convsep", _( "expect 1xN or Nx1 input mask" ) );
im_error( "im_convsep",
"%s", _( "expect 1xN or Nx1 input mask" ) );
return( -1 );
}
if( im_piocheck( in, out ) )
@ -406,7 +407,7 @@ im_convsep_raw( IMAGE *in, IMAGE *out, INTMASK *mask )
out->Xsize -= conv->size - 1;
out->Ysize -= conv->size - 1;
if( out->Xsize <= 0 || out->Ysize <= 0 ) {
im_error( "im_convsep", _( "image too small for mask" ) );
im_error( "im_convsep", "%s", _( "image too small for mask" ) );
return( -1 );
}

View File

@ -286,17 +286,19 @@ im_convsepf_raw( IMAGE *in, IMAGE *out, DOUBLEMASK *mask )
/* Check parameters.
*/
if( !in || in->Coding != IM_CODING_NONE || im_iscomplex( in ) ) {
im_error( "im_convsepf", _( "non-complex uncoded only" ) );
im_error( "im_convsepf",
"%s", _( "non-complex uncoded only" ) );
return( -1 );
}
if( !mask || mask->xsize > 1000 || mask->ysize > 1000 ||
mask->xsize <= 0 || mask->ysize <= 0 || !mask->coeff ||
mask->scale == 0 ) {
im_error( "im_convsepf", _( "bad mask parameters" ) );
im_error( "im_convsepf", "%s", _( "bad mask parameters" ) );
return( -1 );
}
if( mask->xsize != 1 && mask->ysize != 1 ) {
im_error( "im_convsepf", _( "expect 1xN or Nx1 input mask" ) );
im_error( "im_convsepf",
"%s", _( "expect 1xN or Nx1 input mask" ) );
return( -1 );
}
if( im_piocheck( in, out ) )
@ -316,7 +318,8 @@ im_convsepf_raw( IMAGE *in, IMAGE *out, DOUBLEMASK *mask )
out->Xsize -= conv->size - 1;
out->Ysize -= conv->size - 1;
if( out->Xsize <= 0 || out->Ysize <= 0 ) {
im_error( "im_convsepf", _( "image too small for mask" ) );
im_error( "im_convsepf",
"%s", _( "image too small for mask" ) );
return( -1 );
}

View File

@ -355,7 +355,7 @@ embed_new( IMAGE *in, IMAGE *out, int flag, int x, int y, int w, int h )
* test.
*/
if( im_rect_isempty( &embed->rsub ) ) {
im_error( "im_embed", _( "bad dimensions" ) );
im_error( "im_embed", "%s", _( "bad dimensions" ) );
return( NULL );
}
@ -436,15 +436,15 @@ im_embed( IMAGE *in, IMAGE *out, int flag, int x, int y, int w, int h )
if( im_piocheck( in, out ) )
return( -1 );
if( in->Coding != IM_CODING_NONE && in->Coding != IM_CODING_LABQ ) {
im_error( "im_embed", _( "unknown image coding type" ) );
im_error( "im_embed", "%s", _( "unknown image coding type" ) );
return( -1 );
}
if( flag < 0 || flag > 4 ) {
im_error( "im_embed", _( "unknown flag" ) );
im_error( "im_embed", "%s", _( "unknown flag" ) );
return( -1 );
}
if( w <= 0 || h <= 0 ) {
im_error( "im_embed", _( "bad dimensions" ) );
im_error( "im_embed", "%s", _( "bad dimensions" ) );
return( -1 );
}

View File

@ -246,7 +246,7 @@ im_sharpen( IMAGE *in, IMAGE *out,
if( in->Coding != IM_CODING_NONE ||
in->Bands != 3 ||
in->BandFmt != IM_BANDFMT_SHORT ) {
im_error( "im_sharpen", _( "input not 3-band short" ) );
im_error( "im_sharpen", "%s", _( "input not 3-band short" ) );
return( -1 );
}
@ -257,7 +257,7 @@ im_sharpen( IMAGE *in, IMAGE *out,
*/
if( x1 < 0 || x2 < 0 || x1 > 99 || x2 > 99 || x1 > x2 ||
x3 < 0 || x3 > 99 || x1 > x3 ) {
im_error( "im_sharpen", _( "parameters out of range" ) );
im_error( "im_sharpen", "%s", _( "parameters out of range" ) );
return( -1 );
}

View File

@ -226,7 +226,7 @@ shrink_gen( REGION *or, void *vseq, void *a, void *b )
case IM_BANDFMT_DOUBLE: fshrink(double); break;
default:
im_error( "im_shrink", _( "unsupported input format" ) );
im_error( "im_shrink", "%s", _( "unsupported input format" ) );
return( -1 );
}
@ -241,12 +241,12 @@ shrink( IMAGE *in, IMAGE *out, double xshrink, double yshrink )
/* Check parameters.
*/
if( !in || im_iscomplex( in ) ) {
im_error( "im_shrink", _( "non-complex input only" ) );
im_error( "im_shrink", "%s", _( "non-complex input only" ) );
return( -1 );
}
if( xshrink < 1.0 || yshrink < 1.0 ) {
im_error( "im_shrink",
_( "shrink factors should both be >1" ) );
"%s", _( "shrink factors should both be >1" ) );
return( -1 );
}
if( im_piocheck( in, out ) )
@ -261,7 +261,8 @@ shrink( IMAGE *in, IMAGE *out, double xshrink, double yshrink )
out->Xres = in->Xres / xshrink;
out->Yres = in->Yres / yshrink;
if( out->Xsize <= 0 || out->Ysize <= 0 ) {
im_error( "im_shrink", _( "image has shrunk to nothing" ) );
im_error( "im_shrink",
"%s", _( "image has shrunk to nothing" ) );
return( -1 );
}
@ -309,7 +310,7 @@ im_shrink( IMAGE *in, IMAGE *out, double xshrink, double yshrink )
return( -1 );
}
else {
im_error( "im_shrink", _( "unknown coding type" ) );
im_error( "im_shrink", "%s", _( "unknown coding type" ) );
return( -1 );
}

View File

@ -253,7 +253,8 @@ im_spcor_raw( IMAGE *in, IMAGE *ref, IMAGE *out )
*/
if( in->Xsize < ref->Xsize ||
in->Ysize < ref->Ysize ) {
im_error( "im_spcor_raw", _( "ref not smaller than in" ) );
im_error( "im_spcor_raw",
"%s", _( "ref not smaller than in" ) );
return( -1 );
}
@ -264,14 +265,16 @@ im_spcor_raw( IMAGE *in, IMAGE *ref, IMAGE *out )
ref->Coding != IM_CODING_NONE ||
ref->Bands != 1 ||
in->BandFmt != ref->BandFmt ) {
im_error( "im_spcor_raw", _( "input not uncoded 1 band" ) );
im_error( "im_spcor_raw",
"%s", _( "input not uncoded 1 band" ) );
return( -1 );
}
if( in->BandFmt != IM_BANDFMT_UCHAR &&
in->BandFmt != IM_BANDFMT_CHAR &&
in->BandFmt != IM_BANDFMT_SHORT &&
in->BandFmt != IM_BANDFMT_USHORT ) {
im_error( "im_spcor_raw", _( "input not char/uchar/short/ushort" ) );
im_error( "im_spcor_raw",
"%s", _( "input not char/uchar/short/ushort" ) );
return( -1 );
}

View File

@ -268,12 +268,13 @@ im_stretch3( IMAGE *in, IMAGE *out, double dx, double dy )
/* Check our args.
*/
if( in->Coding != IM_CODING_NONE || in->BandFmt != IM_BANDFMT_USHORT ) {
im_error( "im_stretch3", _( "not uncoded unsigned short" ) );
im_error( "im_stretch3",
"%s", _( "not uncoded unsigned short" ) );
return( -1 );
}
if( dx < 0 || dx >= 1.0 || dy < 0 || dy >= 1.0 ) {
im_error( "im_stretch3",
_( "displacements out of range [0,1)" ) );
"%s", _( "displacements out of range [0,1)" ) );
return( -1 );
}
if( im_piocheck( in, out ) )

View File

@ -135,17 +135,17 @@ im_zerox( IMAGE *in, IMAGE *out, int flag )
if( !t1 )
return( -1 );
if( flag != -1 && flag != 1 ) {
im_error( "im_zerox", _( "flag not -1 ot 1" ) );
im_error( "im_zerox", "%s", _( "flag not -1 ot 1" ) );
return( -1 );
}
if( im_piocheck( in, t1 ) )
return( -1 );
if( im_iscomplex( in ) || in->Coding != IM_CODING_NONE ) {
im_error( "im_zerox", _( "non-complex uncoded only" ) );
im_error( "im_zerox", "%s", _( "non-complex uncoded only" ) );
return( -1 );
}
if( in->Xsize < 2 ) {
im_error( "im_zerox", _( "image too narrow" ) );
im_error( "im_zerox", "%s", _( "image too narrow" ) );
return( -1 );
}
if( im_isuint( in ) )

View File

@ -138,7 +138,7 @@ im_create_imask( const char *filename, int xs, int ys )
/* Check args.
*/
if( xs <= 0 || ys <= 0 || filename == NULL ) {
im_error( "im_create_imask", _( "bad arguments" ) );
im_error( "im_create_imask", "%s", _( "bad arguments" ) );
return( NULL );
}
@ -195,7 +195,7 @@ im_create_dmask( const char *filename, int xs, int ys )
/* Check args.
*/
if( xs <= 0 || ys <= 0 || filename == NULL ) {
im_error( "im_create_dmask", _( "bad arguments" ) );
im_error( "im_create_dmask", "%s", _( "bad arguments" ) );
return( NULL );
}
@ -265,7 +265,7 @@ static int
get_line( FILE *fp, char *buf )
{
if( !fgets( buf, IM_MAX_LINE, fp ) ) {
im_error( "read_mask", _( "unexpected EOF" ) );
im_error( "read_mask", "%s", _( "unexpected EOF" ) );
return( -1 );
}
@ -303,11 +303,13 @@ read_header( FILE *fp, int *xs, int *ys, double *scale, double *offset )
ceil( v[1] ) != v[1] ||
v[0] <= 0 ||
v[1] <= 0 ) {
im_error( "read_header", _( "error reading matrix header" ) );
im_error( "read_header",
"%s", _( "error reading matrix header" ) );
return( -1 );
}
if( i == 4 && v[2] == 0 ) {
im_error( "read_header", _( "scale should be non-zero" ) );
im_error( "read_header",
"%s", _( "scale should be non-zero" ) );
return( -1 );
}
@ -387,7 +389,7 @@ im_read_imask( const char *maskfile )
ceil( dmask->offset ) != dmask->offset ) {
im_free_dmask( dmask );
im_error( "im_read_imask",
_( "scale and offset should be int" ) );
"%s", _( "scale and offset should be int" ) );
return( NULL );
}
@ -429,7 +431,7 @@ im_scale_dmask( DOUBLEMASK *m, const char *name )
int isum;
if( !name || m->xsize <= 0 || m->ysize <= 0 ) {
im_error( "im_scale_dmask", _( "bad args" ) );
im_error( "im_scale_dmask", "%s", _( "bad arguments" ) );
return( NULL );
}
if( !(out = im_create_imask( name, m->xsize, m->ysize )) )
@ -554,7 +556,7 @@ write_line( FILE *fp, const char *fmt, ... )
va_start( ap, fmt );
if( !vfprintf( fp, fmt, ap ) ) {
im_error( "write_mask", _( "write error, disc full?" ) );
im_error( "write_mask", "%s", _( "write error, disc full?" ) );
return( -1 );
}
va_end( ap );
@ -612,7 +614,7 @@ int
im_write_imask( INTMASK *m )
{
if( !m->filename ) {
im_error( "im_write_imask", _( "filename not set" ) );
im_error( "im_write_imask", "%s", _( "filename not set" ) );
return( -1 );
}
@ -663,7 +665,7 @@ int
im_write_dmask( DOUBLEMASK *m )
{
if( !m->filename ) {
im_error( "im_write_dmask", _( "filename not set" ) );
im_error( "im_write_dmask", "%s", _( "filename not set" ) );
return( -1 );
}

View File

@ -307,7 +307,7 @@ read_header( const char *header )
return( NULL );
if( len != sizeof( struct dsr ) ) {
im_error( "im_analyze2vips",
_( "header file size incorrect" ) );
"%s", _( "header file size incorrect" ) );
im_free( d );
return( NULL );
}
@ -352,7 +352,7 @@ read_header( const char *header )
if( len != d->hk.sizeof_hdr ) {
im_error( "im_analyze2vips",
_( "header file size incorrect" ) );
"%s", _( "header file size incorrect" ) );
im_free( d );
return( NULL );
}

View File

@ -172,7 +172,7 @@ read_csv( FILE *fp, IMAGE *out,
for( i = 0; i < start_skip; i++ )
if( skip_line( fp ) == EOF ) {
im_error( "im_csv2vips",
_( "end of file while skipping start" ) );
"%s", _( "end of file while skipping start" ) );
return( -1 );
}
@ -180,7 +180,8 @@ read_csv( FILE *fp, IMAGE *out,
* fgetpos() the first time we use it: assume it's working after this.
*/
if( fgetpos( fp, &pos ) ) {
im_error_system( errno, "im_csv2vips", _( "unable to seek" ) );
im_error_system( errno, "im_csv2vips",
"%s", _( "unable to seek" ) );
return( -1 );
}
for( columns = 0; (ch = read_double( fp, whitemap, sepmap,
@ -189,7 +190,7 @@ read_csv( FILE *fp, IMAGE *out,
fsetpos( fp, &pos );
if( columns == 0 ) {
im_error( "im_csv2vips", _( "empty line" ) );
im_error( "im_csv2vips", "%s", _( "empty line" ) );
return( -1 );
}
if( ch == -2 )
@ -223,12 +224,12 @@ read_csv( FILE *fp, IMAGE *out,
y + start_skip + 1, x + 1, &d );
if( ch == EOF ) {
im_error( "im_csv2vips",
_( "unexpected end of file" ) );
"%s", _( "unexpected end of file" ) );
return( -1 );
}
else if( ch == '\n' ) {
im_error( "im_csv2vips",
_( "unexpected end of line" ) );
"%s", _( "unexpected end of line" ) );
return( -1 );
}
else if( ch )

View File

@ -335,7 +335,8 @@ set_vips_resolution( IMAGE *im, ExifData *ed )
if( get_entry_rational( ed, EXIF_TAG_X_RESOLUTION, &xres ) ||
get_entry_rational( ed, EXIF_TAG_Y_RESOLUTION, &yres ) ||
get_entry_short( ed, EXIF_TAG_RESOLUTION_UNIT, &unit ) ) {
im_warn( "im_jpeg2vips", _( "error reading resolution" ) );
im_warn( "im_jpeg2vips",
"%s", _( "error reading resolution" ) );
return;
}
@ -355,7 +356,7 @@ set_vips_resolution( IMAGE *im, ExifData *ed )
break;
default:
im_warn( "im_jpeg2vips", _( "bad resolution unit" ) );
im_warn( "im_jpeg2vips", "%s", _( "bad resolution unit" ) );
return;
}
@ -584,7 +585,8 @@ read_jpeg_image( struct jpeg_decompress_struct *cinfo, IMAGE *out,
*/
for( y = 0; y < out->Ysize; y++ ) {
if( jpeg_read_scanlines( cinfo, &row_pointer[0], 1 ) != 1 ) {
im_error( "im_jpeg2vips", _( "truncated JPEG file" ) );
im_error( "im_jpeg2vips",
"%s", _( "truncated JPEG file" ) );
return( -1 );
}
if( invert_pels ) {

View File

@ -575,7 +575,7 @@ magick_fill_region( REGION *out, void *seq, void *a, void *b )
if( !pixels ) {
im_error( "im_magick2vips",
_( "unable to read pixels" ) );
"%s", _( "unable to read pixels" ) );
return( -1 );
}
@ -633,7 +633,7 @@ magick2vips_header( const char *filename, IMAGE *im )
return( -1 );
if( im->Xsize <= 0 || im->Ysize <= 0 ) {
im_error( "im_magick2vips", _( "bad image size" ) );
im_error( "im_magick2vips", "%s", _( "bad image size" ) );
return( -1 );
}

View File

@ -269,7 +269,7 @@ png2vips( Read *read, int header_only )
case PNG_COLOR_TYPE_RGB_ALPHA: bands = 4; break;
default:
im_error( "im_png2vips", _( "unsupported colour type" ) );
im_error( "im_png2vips", "%s", _( "unsupported colour type" ) );
return( -1 );
}

View File

@ -111,7 +111,7 @@ read_uint( FILE *fp )
buf[i] = '\0';
if( i == 0 ) {
im_error( "im_ppm2vips", _( "bad unsigned int" ) );
im_error( "im_ppm2vips", "%s", _( "bad unsigned int" ) );
return( -1 );
}
@ -161,7 +161,7 @@ read_header( FILE *fp, IMAGE *out, int *bits, int *ascii )
if( strcmp( magic_names[i], buf ) == 0 )
break;
if( i == IM_NUMBER( magic_names ) ) {
im_error( "im_ppm2vips", _( "bad magic number" ) );
im_error( "im_ppm2vips", "%s", _( "bad magic number" ) );
return( -1 );
}
*bits = lookup_bits[i];
@ -190,7 +190,7 @@ read_header( FILE *fp, IMAGE *out, int *bits, int *ascii )
* character before the data starts.
*/
if( !*ascii && !isspace( fgetc( fp ) ) ) {
im_error( "im_ppm2vips",
im_error( "im_ppm2vips", "%s",
_( "not whitespace before start of binary data" ) );
return( -1 );
}

View File

@ -673,7 +673,7 @@ parse_palette( ReadTiff *rtiff, IMAGE *out )
*/
if( !TIFFGetField( rtiff->tiff,
TIFFTAG_COLORMAP, &tred, &tgreen, &tblue ) ) {
im_error( "im_tiff2vips", _( "bad colormap" ) );
im_error( "im_tiff2vips", "%s", _( "bad colormap" ) );
return( -1 );
}
for( i = 0; i < 256; i++ ) {
@ -727,7 +727,8 @@ parse_rgb8( ReadTiff *rtiff, IMAGE *out )
!tfget16( rtiff->tiff, TIFFTAG_SAMPLESPERPIXEL, &bands ) )
return( -1 );
if( bands != 3 && bands != 4 ) {
im_error( "im_tiff2vips", _( "3 or 4 bands RGB TIFF only" ) );
im_error( "im_tiff2vips",
"%s", _( "3 or 4 bands RGB TIFF only" ) );
return( -1 );
}
@ -775,7 +776,8 @@ parse_rgb16( ReadTiff *rtiff, IMAGE *out )
!tfget16( rtiff->tiff, TIFFTAG_SAMPLESPERPIXEL, &bands ) )
return( -1 );
if( bands != 3 && bands != 4 ) {
im_error( "im_tiff2vips", _( "3 or 4 bands RGB TIFF only" ) );
im_error( "im_tiff2vips",
"%s", _( "3 or 4 bands RGB TIFF only" ) );
return( -1 );
}
@ -864,7 +866,8 @@ parse_cmyk( ReadTiff *rtiff, IMAGE *out )
!tfget16( rtiff->tiff, TIFFTAG_SAMPLESPERPIXEL, &bands ) )
return( -1 );
if( bands != 4 && bands != 5 ) {
im_error( "im_tiff2vips", _( "4 or 5 bands CMYK TIFF only" ) );
im_error( "im_tiff2vips",
"%s", _( "4 or 5 bands CMYK TIFF only" ) );
return( -1 );
}
@ -915,7 +918,7 @@ parse_resolution( TIFF *tiff, IMAGE *out )
default:
im_error( "im_tiff2vips",
_( "unknown resolution unit" ) );
"%s", _( "unknown resolution unit" ) );
return( -1 );
}
}
@ -1313,7 +1316,7 @@ read_scanlinewise( ReadTiff *rtiff, IMAGE *out )
/* Read TIFF scanline.
*/
if( TIFFReadScanline( rtiff->tiff, tbuf, y, 0 ) < 0 ) {
im_error( "im_tiff2vips", _( "read error" ) );
im_error( "im_tiff2vips", "%s", _( "read error" ) );
return( -1 );
}

View File

@ -370,7 +370,7 @@ im_tile_cache( IMAGE *in, IMAGE *out,
Read *read;
if( tile_width <= 0 || tile_height <= 0 || max_tiles < -1 ) {
im_error( "im_tile_cache", _( "bad parameters" ) );
im_error( "im_tile_cache", "%s", _( "bad parameters" ) );
return( -1 );
}
if( im_piocheck( in, out ) )

View File

@ -125,7 +125,7 @@ im_vips2csv( IMAGE *in, const char *filename )
if( im_incheck( in ) )
return( -1 );
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_vips2csv", _( "input must be uncoded" ) );
im_error( "im_vips2csv", "%s", _( "input must be uncoded" ) );
return( -1 );
}

View File

@ -223,7 +223,7 @@ write_new( IMAGE *in )
if( !(write->in = im__convert_saveable( in, IM__RGB_CMYK )) ) {
im_error( "im_vips2jpeg",
_( "unable to convert to saveable format" ) );
"%s", _( "unable to convert to saveable format" ) );
write_destroy( write );
return( NULL );
}
@ -324,7 +324,7 @@ set_exif_resolution( ExifData *ed, IMAGE *im )
write_tag( ed, EXIF_TAG_RESOLUTION_UNIT, EXIF_FORMAT_SHORT,
write_short, &unit ) ) {
im_error( "im_jpeg2vips",
_( "error setting JPEG resolution" ) );
"%s", _( "error setting JPEG resolution" ) );
return( -1 );
}
@ -367,7 +367,7 @@ write_exif( Write *write )
*/
exif_data_save_data( ed, &data, &idl );
if( !idl ) {
im_error( "im_jpeg2vips", _( "error saving EXIF" ) );
im_error( "im_jpeg2vips", "%s", _( "error saving EXIF" ) );
exif_data_free( ed );
return( -1 );
}
@ -556,7 +556,8 @@ write_vips( Write *write, int qfac, const char *profile )
if( im_pincheck( in ) )
return( -1 );
if( qfac < 0 || qfac > 100 ) {
im_error( "im_vips2jpeg", _( "qfac should be in 0-100" ) );
im_error( "im_vips2jpeg",
"%s", _( "qfac should be in 0-100" ) );
return( -1 );
}
@ -886,7 +887,8 @@ im_vips2mimejpeg( IMAGE *in, int qfac )
im_close( base );
if( ferror( stdout ) ) {
im_error( "im_vips2mimejpeg", _( "error writing output" ) );
im_error( "im_vips2mimejpeg",
"%s", _( "error writing output" ) );
return( -1 );
}

View File

@ -127,7 +127,7 @@ write_new( IMAGE *in )
if( !(write->in = im__convert_saveable( in, IM__RGBA )) ) {
im_error( "im_vips2png",
_( "unable to convert to RGB for save" ) );
"%s", _( "unable to convert to RGB for save" ) );
write_destroy( write );
return( NULL );
}
@ -208,7 +208,8 @@ write_vips( Write *write, int compress, int interlace )
if( im_pincheck( in ) )
return( -1 );
if( compress < 0 || compress > 9 ) {
im_error( "im_vips2png", _( "compress should be in [0,9]" ) );
im_error( "im_vips2png",
"%s", _( "compress should be in [0,9]" ) );
return( -1 );
}

View File

@ -139,7 +139,8 @@ write_ppm_line_ascii( IMAGE *in, FILE *fp, PEL *p )
}
if( !fprintf( fp, "\n" ) ) {
im_error( "im_vips2ppm", _( "write error ... disc full?" ) );
im_error( "im_vips2ppm",
"%s", _( "write error ... disc full?" ) );
return( -1 );
}
@ -156,7 +157,7 @@ write_ppm_line_binary( IMAGE *in, FILE *fp, PEL *p )
for( x = 0; x < in->Xsize; x++ ) {
if( !fwrite( p, 1, nb, fp ) ) {
im_error( "im_vips2ppm",
_( "write error ... disc full?" ) );
"%s", _( "write error ... disc full?" ) );
return( -1 );
}
@ -255,7 +256,7 @@ im_vips2ppm( IMAGE *in, const char *filename )
ascii = 1;
else {
im_error( "im_vips2ppm",
_( "bad mode string, "
"%s", _( "bad mode string, "
"should be \"binary\" or \"ascii\"" ) );
return( -1 );
}
@ -263,20 +264,21 @@ im_vips2ppm( IMAGE *in, const char *filename )
if( in->Bbits > 8 && !ascii ) {
im_error( "im_vips2ppm",
_( "can't write binary >8 bit images" ) );
"%s", _( "can't write binary >8 bit images" ) );
return( -1 );
}
if( !im_isuint( in ) ) {
im_error( "im_vips2ppm", _( "unsigned int formats only" ) );
im_error( "im_vips2ppm",
"%s", _( "unsigned int formats only" ) );
return( -1 );
}
if( in->Coding != IM_CODING_NONE && in->Coding != IM_CODING_LABQ ) {
im_error( "im_vips2ppm",
_( "uncoded or IM_CODING_LABQ only" ) );
"%s", _( "uncoded or IM_CODING_LABQ only" ) );
return( -1 );
}
if( in->Bands != 1 && in->Bands != 3 ) {
im_error( "im_vips2ppm", _( "1 or 3 band images only" ) );
im_error( "im_vips2ppm", "%s", _( "1 or 3 band images only" ) );
return( -1 );
}

View File

@ -689,7 +689,7 @@ find_new_tile( PyramidLayer *layer )
/* Out of space!
*/
im_error( "im_vips2tiff", _( "layer buffer exhausted -- "
im_error( "im_vips2tiff", "%s", _( "layer buffer exhausted -- "
"try making TIFF output tiles smaller" ) );
return( -1 );
@ -920,7 +920,7 @@ save_tile( TiffWrite *tw, TIFF *tif, PEL *tbuf, REGION *reg, Rect *area )
/* Write to TIFF! easy.
*/
if( TIFFWriteTile( tif, tbuf, area->left, area->top, 0, 0 ) < 0 ) {
im_error( "im_vips2tiff", _( "TIFF write tile failed" ) );
im_error( "im_vips2tiff", "%s", _( "TIFF write tile failed" ) );
return( -1 );
}
@ -995,7 +995,8 @@ new_tile( PyramidLayer *layer, REGION *tile, Rect *area )
else
bit = PYR_TL;
if( layer->tiles[t].bits & bit ) {
im_error( "im_vips2tiff", _( "internal error #9876345" ) );
im_error( "im_vips2tiff",
"%s", _( "internal error #9876345" ) );
return( -1 );
}
layer->tiles[t].bits |= bit;
@ -1246,7 +1247,7 @@ make_tiff_write( IMAGE *im, const char *filename )
if( (r = im_getsuboption( q )) )
if( sscanf( r, "%d", &tw->predictor ) != 1 ) {
im_error( "im_vips2tiff",
_( "bad predictor "
"%s", _( "bad predictor "
"parameter" ) );
return( NULL );
}
@ -1257,7 +1258,7 @@ make_tiff_write( IMAGE *im, const char *filename )
if( (r = im_getsuboption( q )) )
if( sscanf( r, "%d", &tw->predictor ) != 1 ) {
im_error( "im_vips2tiff",
_( "bad predictor "
"%s", _( "bad predictor "
"parameter" ) );
return( NULL );
}
@ -1268,7 +1269,7 @@ make_tiff_write( IMAGE *im, const char *filename )
if( (r = im_getsuboption( q )) )
if( sscanf( r, "%d", &tw->jpqual ) != 1 ) {
im_error( "im_vips2tiff",
_( "bad JPEG quality "
"%s", _( "bad JPEG quality "
"parameter" ) );
return( NULL );
}
@ -1288,23 +1289,24 @@ make_tiff_write( IMAGE *im, const char *filename )
if( (r = im_getsuboption( q )) ) {
if( sscanf( r, "%dx%d",
&tw->tilew, &tw->tileh ) != 2 ) {
im_error( "im_vips2tiff", _( "bad tile "
"sizes" ) );
im_error( "im_vips2tiff", "%s",
_( "bad tile sizes" ) );
return( NULL );
}
if( tw->tilew < 10 || tw->tileh < 10 ||
tw->tilew > 1000 || tw->tileh > 1000 ) {
im_error( "im_vips2tiff", _( "bad tile "
"size %dx%d" ),
im_error( "im_vips2tiff",
_( "bad tile size %dx%d" ),
tw->tilew, tw->tileh );
return( NULL );
}
if( (tw->tilew & 0xf) != 0 ||
(tw->tileh & 0xf) != 0 ) {
im_error( "im_vips2tiff", _( "tile "
"size not a multiple of 16" ) );
im_error( "im_vips2tiff", "%s",
_( "tile size not a "
"multiple of 16" ) );
return( NULL );
}
}
@ -1367,8 +1369,8 @@ make_tiff_write( IMAGE *im, const char *filename )
if( (r = im_getsuboption( q )) ) {
if( sscanf( r, "%fx%f", &tw->xres, &tw->yres ) != 2 ) {
if( sscanf( r, "%f", &tw->xres ) != 1 ) {
im_error( "im_vips2tiff", _( "bad "
"resolution values" ) );
im_error( "im_vips2tiff", "%s",
_( "bad resolution values" ) );
return( NULL );
}
@ -1386,7 +1388,7 @@ make_tiff_write( IMAGE *im, const char *filename )
return( NULL );
}
if( !tw->tile && tw->pyramid ) {
im_warn( "im_vips2tiff", _( "can't have strip pyramid -- "
im_warn( "im_vips2tiff", "%s", _( "can't have strip pyramid -- "
"enabling tiling" ) );
tw->tile = 1;
}
@ -1396,7 +1398,7 @@ make_tiff_write( IMAGE *im, const char *filename )
if( tw->pyramid ) {
if( im->Coding == IM_CODING_NONE && im_iscomplex( im ) ) {
im_error( "im_vips2tiff",
_( "can only pyramid LABQ and "
"%s", _( "can only pyramid LABQ and "
"non-complex images" ) );
return( NULL );
}
@ -1412,7 +1414,7 @@ make_tiff_write( IMAGE *im, const char *filename )
}
if( tw->onebit && tw->compression == COMPRESSION_JPEG ) {
im_warn( "im_vips2tiff", _( "can't have 1-bit JPEG -- "
im_warn( "im_vips2tiff", "%s", _( "can't have 1-bit JPEG -- "
"disabling JPEG" ) );
tw->compression = COMPRESSION_NONE;
}
@ -1584,7 +1586,7 @@ im_vips2tiff( IMAGE *im, const char *filename )
if( im_pincheck( im ) )
return( -1 );
if( im->Coding != IM_CODING_LABQ && im->Coding != IM_CODING_NONE ) {
im_error( "im_vips2tiff", _( "unknown coding type" ) );
im_error( "im_vips2tiff", "%s", _( "unknown coding type" ) );
return( -1 );
}
if( im->BandFmt != IM_BANDFMT_UCHAR &&
@ -1592,13 +1594,15 @@ im_vips2tiff( IMAGE *im, const char *filename )
im->Type == IM_TYPE_LABS) &&
im->BandFmt != IM_BANDFMT_USHORT &&
im->BandFmt != IM_BANDFMT_FLOAT ) {
im_error( "im_vips2tiff", _( "unsigned 8-bit int, 16-bit int, "
im_error( "im_vips2tiff", "%s",
_( "unsigned 8-bit int, 16-bit int, "
"and 32-bit float only" ) );
return( -1 );
}
if( im->Coding == IM_CODING_NONE ) {
if( im->Bands < 1 || im->Bands > 5 ) {
im_error( "im_vips2tiff", _( "1 to 5 bands only" ) );
im_error( "im_vips2tiff", "%s",
_( "1 to 5 bands only" ) );
return( -1 );
}
}

View File

@ -306,7 +306,7 @@ rfwfft1( IMAGE *dummy, IMAGE *in, IMAGE *out )
if( !real || !half_complex || im_pincheck( in ) || im_outcheck( out ) )
return( -1 );
if( in->Coding != IM_CODING_NONE || in->Bands != 1 ) {
im_error( "im_fwfft", _( "one band uncoded only" ) );
im_error( "im_fwfft", "%s", _( "one band uncoded only" ) );
return( -1 );
}
if( im_clip2d( in, real ) )
@ -319,7 +319,8 @@ rfwfft1( IMAGE *dummy, IMAGE *in, IMAGE *out )
if( !(plan = fftw_plan_dft_r2c_2d( in->Ysize, in->Xsize,
planner_scratch, (fftw_complex *) half_complex,
0 )) ) {
im_error( "im_fwfft", _( "unable to create transform plan" ) );
im_error( "im_fwfft",
"%s", _( "unable to create transform plan" ) );
return( -1 );
}
@ -418,7 +419,8 @@ cfwfft1( IMAGE *dummy, IMAGE *in, IMAGE *out )
if( !cmplx || im_pincheck( in ) || im_outcheck( out ) )
return( -1 );
if( in->Coding != IM_CODING_NONE || in->Bands != 1 ) {
im_error( "im_fwfft", _( "one band uncoded only" ) );
im_error( "im_fwfft",
"%s", _( "one band uncoded only" ) );
return( -1 );
}
if( im_clip2dcm( in, cmplx ) )
@ -431,7 +433,8 @@ cfwfft1( IMAGE *dummy, IMAGE *in, IMAGE *out )
(fftw_complex *) planner_scratch,
FFTW_FORWARD,
0 )) ) {
im_error( "im_fwfft", _( "unable to create transform plan" ) );
im_error( "im_fwfft",
"%s", _( "unable to create transform plan" ) );
return( -1 );
}
@ -509,11 +512,12 @@ fwfft1( IMAGE *dummy, IMAGE *in, IMAGE *out )
if( in->Coding != IM_CODING_NONE || in->Bands != 1 ||
im_iscomplex( in ) ) {
im_error( "im_fwfft",
_( "one band non-complex uncoded only" ) );
"%s", _( "one band non-complex uncoded only" ) );
return( -1 );
}
if( !bpx || !bpy ) {
im_error( "im_fwfft", _( "sides must be power of 2" ) );
im_error( "im_fwfft",
"%s", _( "sides must be power of 2" ) );
return( -1 );
}
@ -533,7 +537,8 @@ fwfft1( IMAGE *dummy, IMAGE *in, IMAGE *out )
*/
if( im__fft_sp( (float *) real->data, (float *) imag->data,
bpx - 1, bpy - 1 ) ) {
im_error( "im_fwfft", _( "fft_sp failed" ) );
im_error( "im_fwfft",
"%s", _( "fft_sp failed" ) );
return( -1 );
}

View File

@ -92,7 +92,7 @@ invfft1( IMAGE *dummy, IMAGE *in, IMAGE *out )
if( !cmplx || im_pincheck( in ) || im_poutcheck( out ) )
return( -1 );
if( in->Coding != IM_CODING_NONE || in->Bands != 1 ) {
im_error( "im_invfft", _( "one band uncoded only" ) );
im_error( "im_invfft", "%s", _( "one band uncoded only" ) );
return( -1 );
}
if( im_clip2dcm( in, cmplx ) )
@ -104,7 +104,8 @@ invfft1( IMAGE *dummy, IMAGE *in, IMAGE *out )
if( !(plan = fftw2d_create_plan( in->Ysize, in->Xsize,
FFTW_BACKWARD,
FFTW_MEASURE | FFTW_USE_WISDOM | FFTW_IN_PLACE )) ) {
im_error( "im_invfft", _( "unable to create transform plan" ) );
im_error( "im_invfft",
"%s", _( "unable to create transform plan" ) );
return( -1 );
}
@ -140,7 +141,8 @@ invfft1( IMAGE *dummy, IMAGE *in, IMAGE *out )
if( !cmplx || im_pincheck( in ) || im_poutcheck( out ) )
return( -1 );
if( in->Coding != IM_CODING_NONE || in->Bands != 1 ) {
im_error( "im_invfft", _( "one band uncoded only" ) );
im_error( "im_invfft",
"%s", _( "one band uncoded only" ) );
return( -1 );
}
if( im_clip2dcm( in, cmplx ) )
@ -154,7 +156,8 @@ invfft1( IMAGE *dummy, IMAGE *in, IMAGE *out )
(fftw_complex *) planner_scratch,
FFTW_BACKWARD,
0 )) ) {
im_error( "im_invfft", _( "unable to create transform plan" ) );
im_error( "im_invfft",
"%s", _( "unable to create transform plan" ) );
return( -1 );
}
@ -197,11 +200,13 @@ invfft1( IMAGE *dummy, IMAGE *in, IMAGE *out )
return( -1 );
if( in->Coding != IM_CODING_NONE ||
in->Bands != 1 || !im_iscomplex( in ) ) {
im_error( "im_invfft", _( "one band complex uncoded only" ) );
im_error( "im_invfft",
"%s", _( "one band complex uncoded only" ) );
return( -1 );
}
if( !bpx || !bpy ) {
im_error( "im_invfft", _( "sides must be power of 2" ) );
im_error( "im_invfft",
"%s", _( "sides must be power of 2" ) );
return( -1 );
}
@ -221,7 +226,8 @@ invfft1( IMAGE *dummy, IMAGE *in, IMAGE *out )
*/
if( im__fft_sp( (float *) real->data, (float *) imag->data,
bpx - 1, bpy - 1 ) ) {
im_error( "im_invfft", _( "fft_sp failed" ) );
im_error( "im_invfft",
"%s", _( "fft_sp failed" ) );
return( -1 );
}

View File

@ -169,7 +169,8 @@ invfft1( IMAGE *dummy, IMAGE *in, IMAGE *out )
im_poutcheck( out ) )
return( -1 );
if( in->Coding != IM_CODING_NONE || in->Bands != 1 ) {
im_error( "im_invfft", _( "one band uncoded only" ) );
im_error( "im_invfft",
"%s", _( "one band uncoded only" ) );
return( -1 );
}
@ -207,7 +208,8 @@ invfft1( IMAGE *dummy, IMAGE *in, IMAGE *out )
if( !(plan = fftw_plan_dft_c2r_2d( in->Ysize, in->Xsize,
(fftw_complex *) planner_scratch, (double *) real->data,
0 )) ) {
im_error( "im_invfft", _( "unable to create transform plan" ) );
im_error( "im_invfft",
"%s", _( "unable to create transform plan" ) );
return( -1 );
}
@ -250,11 +252,13 @@ invfft1( IMAGE *dummy, IMAGE *in, IMAGE *out )
return( -1 );
if( in->Coding != IM_CODING_NONE ||
in->Bands != 1 || !im_iscomplex( in ) ) {
im_error( "im_invfft", _( "one band complex uncoded only" ) );
im_error( "im_invfft",
"%s", _( "one band complex uncoded only" ) );
return( -1 );
}
if( !bpx || !bpy ) {
im_error( "im_invfft", _( "sides must be power of 2" ) );
im_error( "im_invfft",
"%s", _( "sides must be power of 2" ) );
return( -1 );
}
@ -274,7 +278,8 @@ invfft1( IMAGE *dummy, IMAGE *in, IMAGE *out )
*/
if( im__fft_sp( (float *) real->data, (float *) imag->data,
bpx - 1, bpy - 1 ) ) {
im_error( "im_invfft", _( "fft_sp failed" ) );
im_error( "im_invfft",
"%s", _( "fft_sp failed" ) );
return( -1 );
}

View File

@ -131,7 +131,8 @@ build_state( State *state, DOUBLEMASK *input )
double v = input->coeff[y * input->xsize];
if( floor( v ) != v ) {
im_error( "im_buildlut", _( "x value not an int" ) );
im_error( "im_buildlut",
"%s", _( "x value not an int" ) );
return( -1 );
}
@ -143,7 +144,7 @@ build_state( State *state, DOUBLEMASK *input )
state->lut_size = xhigh - xlow;
if( state->lut_size < 1 ) {
im_error( "im_buildlut", _( "x range too small" ) );
im_error( "im_buildlut", "%s", _( "x range too small" ) );
return( -1 );
}
@ -214,7 +215,7 @@ im_buildlut( DOUBLEMASK *input, IMAGE *output )
State state;
if( !input || input->xsize < 2 || input->ysize < 1 ) {
im_error( "im_buildlut", _( "bad input matrix size" ) );
im_error( "im_buildlut", "%s", _( "bad input matrix size" ) );
return( -1 );
}

View File

@ -96,11 +96,11 @@ im_histcum( IMAGE *in, IMAGE *out )
int b, x;
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_histcum", _( "input coded" ) );
im_error( "im_histcum", "%s", _( "input coded" ) );
return( -1 );
}
if( px > 65536 ) {
im_error( "im_histcum", _( "input too large" ) );
im_error( "im_histcum", "%s", _( "input too large" ) );
return( -1 );
}
if( im_incheck( in ) )

View File

@ -126,10 +126,7 @@ merge_subhist( void *seq, void *a, void *b )
Histogram *mhist = (Histogram *) a;
int i, j;
/* Sanity!
*/
if( shist->bands != mhist->bands || shist->size != mhist->size )
error_exit( "sanity failure in merge_subhist" );
g_assert( shist->bands == mhist->bands && shist->size == mhist->size );
/* Add on sub-data.
*/
@ -310,7 +307,7 @@ im_histgr( IMAGE *in, IMAGE *out, int bandno )
if( im_pincheck( in ) || im_outcheck( out ) )
return( -1 );
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_histgr", _( "uncoded images only" ) );
im_error( "im_histgr", "%s", _( "uncoded images only" ) );
return( -1 );
}
@ -322,14 +319,14 @@ im_histgr( IMAGE *in, IMAGE *out, int bandno )
in->BandFmt == IM_BANDFMT_USHORT )
size = 65536;
else {
im_error( "im_histgr", _( "input not uchar or ushort" ) );
im_error( "im_histgr", "%s", _( "input not uchar or ushort" ) );
return( -1 );
}
/* How many output bands?
*/
if( bandno > in->Bands || bandno < -1 ) {
im_error( "im_histgr", _( "bad band parameter" ) );
im_error( "im_histgr", "%s", _( "bad band parameter" ) );
return( -1 );
}
if( bandno == -1 )

View File

@ -214,13 +214,13 @@ im_histnD( IMAGE *in, IMAGE *out, int bins )
if( im_pincheck( in ) || im_outcheck( out ) )
return( -1 );
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_histnD", _( " uncoded images only" ) );
im_error( "im_histnD", "%s", _( " uncoded images only" ) );
return( -1 );
}
if( in->BandFmt != IM_BANDFMT_UCHAR &&
in->BandFmt != IM_BANDFMT_USHORT ) {
im_error( "im_histnD",
_( " unsigned 8 or 16 bit images only" ) );
"%s", _( " unsigned 8 or 16 bit images only" ) );
return( -1 );
}

View File

@ -90,11 +90,11 @@ normalise( IMAGE *in, IMAGE *out )
double min, max;
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_histplot", _( "uncoded only" ) );
im_error( "im_histplot", "%s", _( "uncoded only" ) );
return( -1 );
}
if( im_iscomplex( in ) ) {
im_error( "im_histplot", _( "non-complex only" ) );
im_error( "im_histplot", "%s", _( "non-complex only" ) );
return( -1 );
}
@ -184,7 +184,8 @@ make_vert_gen( REGION *or, void *seq, void *a, void *b )
case IM_BANDFMT_DOUBLE: VERT( double ); break;
default:
im_error( "im_histplot", _( "internal error #8255" ) );
im_error( "im_histplot",
"%s", _( "internal error #8255" ) );
return( -1 );
}
}
@ -238,7 +239,8 @@ make_horz_gen( REGION *or, void *seq, void *a, void *b )
case IM_BANDFMT_DOUBLE: HORZ( double ); break;
default:
im_error( "im_histplot", _( "internal error #8255" ) );
im_error( "im_histplot",
"%s", _( "internal error #8255" ) );
return( -1 );
}
}
@ -267,7 +269,7 @@ plot( IMAGE *in, IMAGE *out )
im_max( in, &max ) )
return( -1 );
if( max < 0 ) {
im_errormsg( "im_histplot: internal error #8254" );
im_error( "im_histplot", "%s", _( "internal error #8254" ) );
return( -1 );
}
if( in->BandFmt == IM_BANDFMT_UCHAR )
@ -326,7 +328,7 @@ im_histplot( IMAGE *hist, IMAGE *histplot )
if( !norm )
return( -1 );
if( hist->Xsize != 1 && hist->Ysize != 1 ) {
im_error( "im_histplot", _( "Xsize or Ysize not 1" ) );
im_error( "im_histplot", "%s", _( "Xsize or Ysize not 1" ) );
return( -1 );
}

View File

@ -157,15 +157,16 @@ im_lhisteq_raw( IMAGE *in, IMAGE *out, int xwin, int ywin )
return( -1 );
if( in->Bbits != IM_BBITS_BYTE || in->BandFmt != IM_BANDFMT_UCHAR ||
in->Bands != 1 || in->Coding != IM_CODING_NONE ) {
im_error( "im_lhisteq", _( "one band uchar uncoded only" ) );
im_error( "im_lhisteq",
"%s", _( "one band uchar uncoded only" ) );
return( -1 );
}
if( xwin > in->Xsize || ywin > in->Ysize ) {
im_error( "im_lhisteq", _( "window too large" ) );
im_error( "im_lhisteq", "%s", _( "window too large" ) );
return( -1 );
}
if( xwin <= 0 || ywin <= 0 ) {
im_error( "im_lhisteq", _( "window too small" ) );
im_error( "im_lhisteq", "%s", _( "window too small" ) );
return( -1 );
}
if( im_cp_desc( out, in ) )

View File

@ -481,7 +481,7 @@ maplut_start( IMAGE *out, void *a, void *b )
case IM_BANDFMT_USHORT: GEN( unsigned short, OUT ); break; \
case IM_BANDFMT_UINT: GEN( unsigned int, OUT ); break; \
default: \
im_error( "im_maplut", _( "bad input file" ) ); \
im_error( "im_maplut", "%s", _( "bad input file" ) ); \
return( -1 ); \
}
@ -512,7 +512,7 @@ maplut_start( IMAGE *out, void *a, void *b )
case IM_BANDFMT_DPCOMPLEX: inner_switch( UCHAR_FC, GEN_FC, \
double ); break; \
default: \
im_error( "im_maplut", _( "bad lut file" ) ); \
im_error( "im_maplut", "%s", _( "bad lut file" ) ); \
return( -1 ); \
}
@ -565,11 +565,11 @@ im_maplut( IMAGE *in, IMAGE *out, IMAGE *lut )
/* Check lut.
*/
if( lut->Coding != IM_CODING_NONE ) {
im_error( "im_maplut", _( "lut is not uncoded" ) );
im_error( "im_maplut", "%s", _( "lut is not uncoded" ) );
return( -1 );
}
if( lut->Xsize * lut->Ysize > 100000 ) {
im_error( "im_maplut", _( "lut seems very large!" ) );
im_error( "im_maplut", "%s", _( "lut seems very large!" ) );
return( -1 );
}
@ -581,24 +581,24 @@ im_maplut( IMAGE *in, IMAGE *out, IMAGE *lut )
/* Check args.
*/
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_maplut", _( "input is not uncoded" ) );
im_error( "im_maplut", "%s", _( "input is not uncoded" ) );
return( -1 );
}
if( !im_isuint( in ) ) {
im_error( "im_maplut", _( "input is not some unsigned "
"integer type" ) );
im_error( "im_maplut", "%s",
_( "input is not some unsigned integer type" ) );
return( -1 );
}
if( in->Bands != 1 && lut->Bands != 1 && lut->Bands != in->Bands ) {
im_error( "im_maplut", _( "lut should have 1 band, or same "
"number of bands as input, or any number of bands "
"if input has 1 band" ) );
im_error( "im_maplut", "%s", _( "lut should have 1 band, "
"or same number of bands as input, "
"or any number of bands if input has 1 band" ) );
return( -1 );
}
if( in->BandFmt == IM_BANDFMT_UCHAR &&
lut->Xsize * lut->Ysize != 256 ) {
im_error( "im_maplut", _( "input is uchar and lut does not "
"have 256 elements" ) );
im_error( "im_maplut", "%s", _( "input is uchar and lut "
"does not have 256 elements" ) );
return( -1 );
}

View File

@ -255,11 +255,11 @@ im_project( IMAGE *in, IMAGE *hout, IMAGE *vout )
if( im_pincheck( in ) || im_outcheck( hout ) || im_outcheck( vout ) )
return( -1 );
if( in->Coding != IM_CODING_NONE ) {
im_error( "im_project", _( "uncoded images only" ) );
im_error( "im_project", "%s", _( "uncoded images only" ) );
return( -1 );
}
if( im_iscomplex( in ) ) {
im_error( "im_project", _( "non-complex images only" ) );
im_error( "im_project", "%s", _( "non-complex images only" ) );
return( -1 );
}

View File

@ -230,35 +230,42 @@ im_tone_build_range( IMAGE *out,
if( in_max < 0 || in_max > 65535 ||
out_max < 0 || out_max > 65535 ) {
im_error( "im_tone_build",
_( "bad in_max, out_max parameters" ) );
"%s", _( "bad in_max, out_max parameters" ) );
return( -1 );
}
if( Lb < 0 || Lb > 100 || Lw < 0 || Lw > 100 || Lb > Lw ) {
im_error( "im_tone_build", _( "bad Lb, Lw parameters" ) );
im_error( "im_tone_build",
"%s", _( "bad Lb, Lw parameters" ) );
return( -1 );
}
if( Ps < 0.0 || Ps > 1.0 ) {
im_error( "im_tone_build", _( "Ps not in range [0.0,1.0]" ) );
im_error( "im_tone_build",
"%s", _( "Ps not in range [0.0,1.0]" ) );
return( -1 );
}
if( Pm < 0.0 || Pm > 1.0 ) {
im_error( "im_tone_build", _( "Pm not in range [0.0,1.0]" ) );
im_error( "im_tone_build",
"%s", _( "Pm not in range [0.0,1.0]" ) );
return( -1 );
}
if( Ph < 0.0 || Ph > 1.0 ) {
im_error( "im_tone_build", _( "Ph not in range [0.0,1.0]" ) );
im_error( "im_tone_build",
"%s", _( "Ph not in range [0.0,1.0]" ) );
return( -1 );
}
if( S < -30 || S > 30 ) {
im_error( "im_tone_build", _( "S not in range [-30,+30]" ) );
im_error( "im_tone_build",
"%s", _( "S not in range [-30,+30]" ) );
return( -1 );
}
if( M < -30 || M > 30 ) {
im_error( "im_tone_build", _( "M not in range [-30,+30]" ) );
im_error( "im_tone_build",
"%s", _( "M not in range [-30,+30]" ) );
return( -1 );
}
if( H < -30 || H > 30 ) {
im_error( "im_tone_build", _( "H not in range [-30,+30]" ) );
im_error( "im_tone_build",
"%s", _( "H not in range [-30,+30]" ) );
return( -1 );
}
@ -339,7 +346,8 @@ im_ismonotonic( IMAGE *lut, int *out )
/* Can be either a horizontal or vertical LUT.
*/
if( lut->Xsize != 1 && lut->Ysize != 1 ) {
im_error( "im_ismonotonic", _( "not 1 by n or n by 1 image" ) );
im_error( "im_ismonotonic",
"%s", _( "not 1 by n or n by 1 image" ) );
return( -1 );
}
@ -387,13 +395,14 @@ im_tone_map( IMAGE *in, IMAGE *out, IMAGE *lut )
/* Need a 1024-point IM_BANDFMT_SHORT lut.
*/
if( lut->Xsize != 1 && lut->Ysize != 1 ) {
im_error( "im_tone_map", _( "not 1 by n or n by 1 image" ) );
im_error( "im_tone_map",
"%s", _( "not 1 by n or n by 1 image" ) );
return( -1 );
}
if( lut->Xsize*lut->Ysize != 1024 ||
lut->BandFmt != IM_BANDFMT_SHORT ) {
im_error( "im_tone_map",
_( "not 1024-point IM_BANDFMT_SHORT lut" ) );
"%s", _( "not 1024-point IM_BANDFMT_SHORT lut" ) );
return( -1 );
}
@ -410,7 +419,8 @@ im_tone_map( IMAGE *in, IMAGE *out, IMAGE *lut )
*/
if( t1->Coding != IM_CODING_NONE || t1->BandFmt != IM_BANDFMT_SHORT ||
t1->Bands != 3 ) {
im_error( "im_tone_map", _( "input not LabS or LabQ" ) );
im_error( "im_tone_map",
"%s", _( "input not LabS or LabQ" ) );
return( -1 );
}
@ -484,7 +494,8 @@ im_tone_analyse(
*/
if( t1->Coding != IM_CODING_NONE || t1->BandFmt != IM_BANDFMT_SHORT ||
t1->Bands != 3 ) {
im_error( "im_tone_analyse", _( "input not LabS or LabQ" ) );
im_error( "im_tone_analyse",
"%s", _( "input not LabS or LabQ" ) );
return( -1 );
}

View File

@ -326,7 +326,8 @@ im_flood( IMAGE *im, int x, int y, PEL *ink, Rect *dout )
if( im_rwcheck( im ) )
return( -1 );
if( im->Coding != IM_CODING_NONE && im->Coding != IM_CODING_LABQ ) {
im_error( "im_flood", _( "uncoded or IM_CODING_LABQ only" ) );
im_error( "im_flood",
"%s", _( "uncoded or IM_CODING_LABQ only" ) );
return( -1 );
}
if( !(st = build_state( im, x, y, ink, dout )) )
@ -372,7 +373,8 @@ im_flood_blob( IMAGE *im, int x, int y, PEL *ink, Rect *dout )
if( im_rwcheck( im ) )
return( -1 );
if( im->Coding != IM_CODING_NONE && im->Coding != IM_CODING_LABQ ) {
im_error( "im_flood", _( "uncoded or IM_CODING_LABQ only" ) );
im_error( "im_flood",
"%s", _( "uncoded or IM_CODING_LABQ only" ) );
return( -1 );
}
if( !(st = build_state( im, x, y, ink, dout )) )

View File

@ -80,12 +80,13 @@ im_insertplace( IMAGE *big, IMAGE *small, int x, int y )
*/
if( big->BandFmt != small->BandFmt || big->Bands != small->Bands ||
big->Coding != small->Coding ) {
im_error( "im_insertplace", _( "inputs differ in format" ) );
im_error( "im_insertplace",
"%s", _( "inputs differ in format" ) );
return( -1 );
}
if( big->Coding != IM_CODING_NONE && big->Coding != IM_CODING_LABQ ) {
im_error( "im_insertplace", _( "input should be uncoded "
"or IM_CODING_LABQ" ) );
im_error( "im_insertplace", "%s",
_( "input should be uncoded or IM_CODING_LABQ" ) );
return( -1 );
}
@ -103,7 +104,8 @@ im_insertplace( IMAGE *big, IMAGE *small, int x, int y )
/* Small fits inside big?
*/
if( !im_rect_includesrect( &br, &sr ) ) {
im_error( "im_insertplace", _( "small not inside big" ) );
im_error( "im_insertplace",
"%s", _( "small not inside big" ) );
return( -1 );
}

View File

@ -226,7 +226,7 @@ im_plotmask( IMAGE *im, int ix, int iy, PEL *ink, PEL *mask, Rect *r )
default:
im_error( "im_plotmask",
_( "internal error" ) );
"%s", _( "internal error" ) );
return( -1 );
}
}

View File

@ -167,7 +167,7 @@ lineset_vec( im_object *argv )
im_intvec_object *y2v = (im_intvec_object *) argv[7];
if( x1v->n != y1v->n || x1v->n != x2v->n || x1v->n != y2v->n ) {
im_error( "im_lineset", _( "vectors not same length" ) );
im_error( "im_lineset", "%s", _( "vectors not same length" ) );
return( -1 );
}
@ -236,7 +236,8 @@ flood_blob_copy_vec( im_object *argv )
PEL *ink;
if( dv->n != in->Bands ) {
im_error( "im_flood_blob_copy", _( "bad vector length" ) );
im_error( "im_flood_blob_copy",
"%s", _( "bad vector length" ) );
return( -1 );
}
if( !(ink = vector_to_ink( in, dv->vec )) )

View File

@ -412,17 +412,17 @@ im_lineset( IMAGE *in, IMAGE *out, IMAGE *mask, IMAGE *ink,
if( mask->Bands != 1 || mask->BandFmt != IM_BANDFMT_UCHAR ||
mask->Coding != IM_CODING_NONE ) {
im_error( "im_lineset",
_( "mask image not 1 band 8 bit uncoded" ) );
"%s", _( "mask image not 1 band 8 bit uncoded" ) );
return( -1 );
}
if( ink->Bands != in->Bands || ink->BandFmt != in->BandFmt ||
ink->Coding != in->Coding ) {
im_error( "im_lineset",
_( "ink image does not match in image" ) );
"%s", _( "ink image does not match in image" ) );
return( -1 );
}
if( ink->Xsize != 1 || ink->Ysize != 1 ) {
im_error( "im_lineset", _( "ink image not 1x1 pixels" ) );
im_error( "im_lineset", "%s", _( "ink image not 1x1 pixels" ) );
return( -1 );
}

Some files were not shown because too many files have changed in this diff Show More