From d6205c1068cbb8d3ffb543c2eaa3c4df758e2871 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Sun, 2 Nov 2008 22:11:01 +0000 Subject: [PATCH] patches for ubuntu 8.10 --- TODO | 2 ++ configure.in | 2 +- libsrc/acquire/im_clamp.c | 4 +-- libsrc/arithmetic/arith_dispatch.c | 3 +- libsrc/arithmetic/im_abs.c | 4 +-- libsrc/arithmetic/im_add.c | 6 ++-- libsrc/arithmetic/im_avg.c | 4 +-- libsrc/arithmetic/im_bandmean.c | 2 +- libsrc/arithmetic/im_ceil.c | 2 +- libsrc/arithmetic/im_costra.c | 8 ++--- libsrc/arithmetic/im_deviate.c | 4 +-- libsrc/arithmetic/im_divide.c | 4 +-- libsrc/arithmetic/im_expntra.c | 4 +-- libsrc/arithmetic/im_floor.c | 2 +- libsrc/arithmetic/im_gadd.c | 4 +-- libsrc/arithmetic/im_invert.c | 4 +-- libsrc/arithmetic/im_lintra.c | 2 +- libsrc/arithmetic/im_log10tra.c | 4 +-- libsrc/arithmetic/im_logtra.c | 4 +-- libsrc/arithmetic/im_max.c | 2 +- libsrc/arithmetic/im_maxpos.c | 2 +- libsrc/arithmetic/im_maxpos_avg.c | 8 ++--- libsrc/arithmetic/im_maxpos_vec.c | 16 ++++----- libsrc/arithmetic/im_measure.c | 4 +-- libsrc/arithmetic/im_min.c | 2 +- libsrc/arithmetic/im_minpos.c | 2 +- libsrc/arithmetic/im_multiply.c | 7 ++-- libsrc/arithmetic/im_point_bilinear.c | 10 +++--- libsrc/arithmetic/im_powtra.c | 4 +-- libsrc/arithmetic/im_remainder.c | 11 +++--- libsrc/arithmetic/im_rint.c | 2 +- libsrc/arithmetic/im_sign.c | 2 +- libsrc/arithmetic/im_sintra.c | 8 ++--- libsrc/arithmetic/im_stats.c | 4 +-- libsrc/arithmetic/im_subtract.c | 5 +-- libsrc/arithmetic/im_tantra.c | 8 ++--- libsrc/cimg/cimg.cpp | 14 ++++---- libsrc/colour/im_Lab2XYZ.c | 2 +- libsrc/colour/im_XYZ2Lab.c | 2 +- libsrc/colour/im_XYZ2disp.c | 3 +- libsrc/colour/im_disp2XYZ.c | 3 +- libsrc/colour/im_icc_transform.c | 33 ++++++++++-------- libsrc/conversion/im_clip.c | 4 +-- libsrc/conversion/im_copy.c | 10 +++--- libsrc/conversion/im_extract.c | 9 ++--- libsrc/conversion/im_falsecolour.c | 4 +-- libsrc/conversion/im_fliphor.c | 2 +- libsrc/conversion/im_gbandjoin.c | 9 ++--- libsrc/conversion/im_grid.c | 4 +-- libsrc/conversion/im_insert.c | 12 +++---- libsrc/conversion/im_msb.c | 16 +++++---- libsrc/conversion/im_rightshift_size.c | 14 ++++---- libsrc/conversion/im_rot180.c | 3 +- libsrc/conversion/im_rot270.c | 3 +- libsrc/conversion/im_rot90.c | 3 +- libsrc/conversion/im_subsample.c | 6 ++-- libsrc/conversion/im_text.c | 9 +++-- libsrc/conversion/im_vips2mask.c | 4 +-- libsrc/conversion/im_zoom.c | 14 ++++---- libsrc/convolution/im_contrast_surface.c | 6 ++-- libsrc/convolution/im_convf.c | 6 ++-- libsrc/convolution/im_convsep.c | 9 ++--- libsrc/convolution/im_convsepf.c | 11 +++--- libsrc/convolution/im_embed.c | 8 ++--- libsrc/convolution/im_sharpen.c | 4 +-- libsrc/convolution/im_shrink.c | 11 +++--- libsrc/convolution/im_spcor.c | 9 +++-- libsrc/convolution/im_stretch3.c | 5 +-- libsrc/convolution/im_zerox.c | 6 ++-- libsrc/convolution/rw_mask.c | 22 ++++++------ libsrc/format/im_analyze2vips.c | 4 +-- libsrc/format/im_csv2vips.c | 11 +++--- libsrc/format/im_jpeg2vips.c | 8 +++-- libsrc/format/im_magick2vips.c | 4 +-- libsrc/format/im_png2vips.c | 2 +- libsrc/format/im_ppm2vips.c | 6 ++-- libsrc/format/im_tiff2vips.c | 15 ++++---- libsrc/format/im_tile_cache.c | 2 +- libsrc/format/im_vips2csv.c | 2 +- libsrc/format/im_vips2jpeg.c | 12 ++++--- libsrc/format/im_vips2png.c | 5 +-- libsrc/format/im_vips2ppm.c | 16 +++++---- libsrc/format/im_vips2tiff.c | 44 +++++++++++++----------- libsrc/freq_filt/im_fwfft.c | 19 ++++++---- libsrc/freq_filt/im_invfft.c | 20 +++++++---- libsrc/freq_filt/im_invfftr.c | 15 +++++--- libsrc/histograms_lut/im_buildlut.c | 7 ++-- libsrc/histograms_lut/im_histeq.c | 4 +-- libsrc/histograms_lut/im_histgr.c | 11 +++--- libsrc/histograms_lut/im_histnD.c | 4 +-- libsrc/histograms_lut/im_histplot.c | 14 ++++---- libsrc/histograms_lut/im_lhisteq.c | 7 ++-- libsrc/histograms_lut/im_maplut.c | 24 ++++++------- libsrc/histograms_lut/im_project.c | 4 +-- libsrc/histograms_lut/tone.c | 37 +++++++++++++------- libsrc/inplace/im_flood.c | 6 ++-- libsrc/inplace/im_insertplace.c | 10 +++--- libsrc/inplace/im_plotmask.c | 2 +- libsrc/inplace/inplace_dispatch.c | 5 +-- libsrc/inplace/line_draw.c | 6 ++-- libsrc/inplace/smudge_area.c | 4 +-- libsrc/iofuncs/base64.c | 6 ++-- libsrc/iofuncs/dispatch_types.c | 6 ++-- libsrc/iofuncs/im_binfile.c | 3 +- libsrc/iofuncs/im_cp_desc.c | 3 +- libsrc/iofuncs/im_demand_hint.c | 3 +- libsrc/iofuncs/im_generate.c | 9 +++-- libsrc/iofuncs/im_iocheck.c | 21 +++++++---- libsrc/iofuncs/im_mapfile.c | 32 ++++++++++------- libsrc/iofuncs/im_open.c | 2 +- libsrc/iofuncs/im_open_vips.c | 27 ++++++++------- libsrc/iofuncs/im_prepare.c | 12 ++++--- libsrc/iofuncs/im_printdesc.c | 2 +- libsrc/iofuncs/im_render.c | 9 +++-- libsrc/iofuncs/im_setupout.c | 9 +++-- libsrc/iofuncs/im_wbuffer.c | 6 ++-- libsrc/iofuncs/im_wrapmany.c | 4 +-- libsrc/iofuncs/package.c | 8 ++--- libsrc/iofuncs/region.c | 20 +++++++---- libsrc/iofuncs/threadgroup.c | 2 +- libsrc/iofuncs/util.c | 14 ++++---- libsrc/morphology/im_dilate.c | 6 ++-- libsrc/morphology/im_erode.c | 6 ++-- libsrc/mosaicing/global_balance.c | 20 ++++++----- libsrc/mosaicing/im_affine.c | 9 +++-- libsrc/mosaicing/im_affinei.c | 7 ++-- libsrc/mosaicing/im_lrmerge.c | 20 ++++++----- libsrc/mosaicing/im_tbmerge.c | 15 ++++---- libsrc/mosaicing/mosaic1.c | 4 +-- libsrc/mosaicing/mosaicing_dispatch.c | 2 +- 130 files changed, 599 insertions(+), 464 deletions(-) diff --git a/TODO b/TODO index db7eeb02..7e0e5607 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,5 @@ +- relational/video still to do + - built with O2, experiment with - floorf() diff --git a/configure.in b/configure.in index 21d567ba..de320b85 100644 --- a/configure.in +++ b/configure.in @@ -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. diff --git a/libsrc/acquire/im_clamp.c b/libsrc/acquire/im_clamp.c index df072687..86df7570 100644 --- a/libsrc/acquire/im_clamp.c +++ b/libsrc/acquire/im_clamp.c @@ -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 ); } diff --git a/libsrc/arithmetic/arith_dispatch.c b/libsrc/arithmetic/arith_dispatch.c index c2e56762..848f8732 100644 --- a/libsrc/arithmetic/arith_dispatch.c +++ b/libsrc/arithmetic/arith_dispatch.c @@ -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 ); } diff --git a/libsrc/arithmetic/im_abs.c b/libsrc/arithmetic/im_abs.c index f8f645d7..fa9cda5b 100644 --- a/libsrc/arithmetic/im_abs.c +++ b/libsrc/arithmetic/im_abs.c @@ -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 ); } diff --git a/libsrc/arithmetic/im_add.c b/libsrc/arithmetic/im_add.c index df9c31f8..1fc73b3c 100644 --- a/libsrc/arithmetic/im_add.c +++ b/libsrc/arithmetic/im_add.c @@ -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 ) ) diff --git a/libsrc/arithmetic/im_avg.c b/libsrc/arithmetic/im_avg.c index 78ea07ff..21aac595 100644 --- a/libsrc/arithmetic/im_avg.c +++ b/libsrc/arithmetic/im_avg.c @@ -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 ); } diff --git a/libsrc/arithmetic/im_bandmean.c b/libsrc/arithmetic/im_bandmean.c index 721eb6eb..dd602afb 100644 --- a/libsrc/arithmetic/im_bandmean.c +++ b/libsrc/arithmetic/im_bandmean.c @@ -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 ); } diff --git a/libsrc/arithmetic/im_ceil.c b/libsrc/arithmetic/im_ceil.c index 9d85a6e9..eb3eb290 100644 --- a/libsrc/arithmetic/im_ceil.c +++ b/libsrc/arithmetic/im_ceil.c @@ -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 ); } diff --git a/libsrc/arithmetic/im_costra.c b/libsrc/arithmetic/im_costra.c index 9330ab5b..abe022c4 100644 --- a/libsrc/arithmetic/im_costra.c +++ b/libsrc/arithmetic/im_costra.c @@ -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 ); } diff --git a/libsrc/arithmetic/im_deviate.c b/libsrc/arithmetic/im_deviate.c index 24e6d39e..addb7097 100644 --- a/libsrc/arithmetic/im_deviate.c +++ b/libsrc/arithmetic/im_deviate.c @@ -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 ); } diff --git a/libsrc/arithmetic/im_divide.c b/libsrc/arithmetic/im_divide.c index e800dcd6..c17755db 100644 --- a/libsrc/arithmetic/im_divide.c +++ b/libsrc/arithmetic/im_divide.c @@ -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 ) ) diff --git a/libsrc/arithmetic/im_expntra.c b/libsrc/arithmetic/im_expntra.c index debe8d45..7a927c88 100644 --- a/libsrc/arithmetic/im_expntra.c +++ b/libsrc/arithmetic/im_expntra.c @@ -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 ) { diff --git a/libsrc/arithmetic/im_floor.c b/libsrc/arithmetic/im_floor.c index 2ee3e8b8..9ad229c6 100644 --- a/libsrc/arithmetic/im_floor.c +++ b/libsrc/arithmetic/im_floor.c @@ -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 ); } diff --git a/libsrc/arithmetic/im_gadd.c b/libsrc/arithmetic/im_gadd.c index bd227518..5b35b666 100644 --- a/libsrc/arithmetic/im_gadd.c +++ b/libsrc/arithmetic/im_gadd.c @@ -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 */ diff --git a/libsrc/arithmetic/im_invert.c b/libsrc/arithmetic/im_invert.c index 14b7a0fb..d660b173 100644 --- a/libsrc/arithmetic/im_invert.c +++ b/libsrc/arithmetic/im_invert.c @@ -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 ) ) diff --git a/libsrc/arithmetic/im_lintra.c b/libsrc/arithmetic/im_lintra.c index 7bc89ba3..af8af422 100644 --- a/libsrc/arithmetic/im_lintra.c +++ b/libsrc/arithmetic/im_lintra.c @@ -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 ); } diff --git a/libsrc/arithmetic/im_log10tra.c b/libsrc/arithmetic/im_log10tra.c index 14c8b26d..45399112 100644 --- a/libsrc/arithmetic/im_log10tra.c +++ b/libsrc/arithmetic/im_log10tra.c @@ -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 ); } diff --git a/libsrc/arithmetic/im_logtra.c b/libsrc/arithmetic/im_logtra.c index 34061a6d..d29861af 100644 --- a/libsrc/arithmetic/im_logtra.c +++ b/libsrc/arithmetic/im_logtra.c @@ -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 ); } diff --git a/libsrc/arithmetic/im_max.c b/libsrc/arithmetic/im_max.c index 688d17cf..172a533b 100644 --- a/libsrc/arithmetic/im_max.c +++ b/libsrc/arithmetic/im_max.c @@ -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 ); } diff --git a/libsrc/arithmetic/im_maxpos.c b/libsrc/arithmetic/im_maxpos.c index 1c2ce831..3a25214f 100644 --- a/libsrc/arithmetic/im_maxpos.c +++ b/libsrc/arithmetic/im_maxpos.c @@ -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 ); } diff --git a/libsrc/arithmetic/im_maxpos_avg.c b/libsrc/arithmetic/im_maxpos_avg.c index c176172f..5427aaa1 100644 --- a/libsrc/arithmetic/im_maxpos_avg.c +++ b/libsrc/arithmetic/im_maxpos_avg.c @@ -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 ) ) diff --git a/libsrc/arithmetic/im_maxpos_vec.c b/libsrc/arithmetic/im_maxpos_vec.c index 67a425de..5542a091 100644 --- a/libsrc/arithmetic/im_maxpos_vec.c +++ b/libsrc/arithmetic/im_maxpos_vec.c @@ -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; } diff --git a/libsrc/arithmetic/im_measure.c b/libsrc/arithmetic/im_measure.c index 31d53fda..55460f86 100644 --- a/libsrc/arithmetic/im_measure.c +++ b/libsrc/arithmetic/im_measure.c @@ -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 ); } diff --git a/libsrc/arithmetic/im_min.c b/libsrc/arithmetic/im_min.c index 55b926d7..55a76c70 100644 --- a/libsrc/arithmetic/im_min.c +++ b/libsrc/arithmetic/im_min.c @@ -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 ); } diff --git a/libsrc/arithmetic/im_minpos.c b/libsrc/arithmetic/im_minpos.c index 98a1e966..6861d69a 100644 --- a/libsrc/arithmetic/im_minpos.c +++ b/libsrc/arithmetic/im_minpos.c @@ -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 ); } diff --git a/libsrc/arithmetic/im_multiply.c b/libsrc/arithmetic/im_multiply.c index 5747aa18..7e2488cf 100644 --- a/libsrc/arithmetic/im_multiply.c +++ b/libsrc/arithmetic/im_multiply.c @@ -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 ) ) diff --git a/libsrc/arithmetic/im_point_bilinear.c b/libsrc/arithmetic/im_point_bilinear.c index b55d2bad..3440a783 100644 --- a/libsrc/arithmetic/im_point_bilinear.c +++ b/libsrc/arithmetic/im_point_bilinear.c @@ -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( ®-> valid, &need ) ){ - im_error( FUNCTION_NAME, _("coords outside image") ); + im_error( FUNCTION_NAME, "%s", _("coords outside image") ); im_region_free( reg ); return -1; } diff --git a/libsrc/arithmetic/im_powtra.c b/libsrc/arithmetic/im_powtra.c index 80e7d368..49e1176d 100644 --- a/libsrc/arithmetic/im_powtra.c +++ b/libsrc/arithmetic/im_powtra.c @@ -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 ) { diff --git a/libsrc/arithmetic/im_remainder.c b/libsrc/arithmetic/im_remainder.c index ff51899b..8f6a0479 100644 --- a/libsrc/arithmetic/im_remainder.c +++ b/libsrc/arithmetic/im_remainder.c @@ -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 ); } } diff --git a/libsrc/arithmetic/im_rint.c b/libsrc/arithmetic/im_rint.c index da628948..13ffed1f 100644 --- a/libsrc/arithmetic/im_rint.c +++ b/libsrc/arithmetic/im_rint.c @@ -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 ); } diff --git a/libsrc/arithmetic/im_sign.c b/libsrc/arithmetic/im_sign.c index 29aa206b..783016d9 100644 --- a/libsrc/arithmetic/im_sign.c +++ b/libsrc/arithmetic/im_sign.c @@ -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 ) ) diff --git a/libsrc/arithmetic/im_sintra.c b/libsrc/arithmetic/im_sintra.c index 2024e5f4..feefb092 100644 --- a/libsrc/arithmetic/im_sintra.c +++ b/libsrc/arithmetic/im_sintra.c @@ -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 ); } diff --git a/libsrc/arithmetic/im_stats.c b/libsrc/arithmetic/im_stats.c index f234b184..fd3a4067 100644 --- a/libsrc/arithmetic/im_stats.c +++ b/libsrc/arithmetic/im_stats.c @@ -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 ); } diff --git a/libsrc/arithmetic/im_subtract.c b/libsrc/arithmetic/im_subtract.c index 82e329c7..6491b6ed 100644 --- a/libsrc/arithmetic/im_subtract.c +++ b/libsrc/arithmetic/im_subtract.c @@ -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 ) ) diff --git a/libsrc/arithmetic/im_tantra.c b/libsrc/arithmetic/im_tantra.c index 9cbd0801..78cf6f31 100644 --- a/libsrc/arithmetic/im_tantra.c +++ b/libsrc/arithmetic/im_tantra.c @@ -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 ); } diff --git a/libsrc/cimg/cimg.cpp b/libsrc/cimg/cimg.cpp index a3d28c25..12fd2771 100644 --- a/libsrc/cimg/cimg.cpp +++ b/libsrc/cimg/cimg.cpp @@ -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 ); } diff --git a/libsrc/colour/im_Lab2XYZ.c b/libsrc/colour/im_Lab2XYZ.c index 2ee6431c..9749248c 100644 --- a/libsrc/colour/im_Lab2XYZ.c +++ b/libsrc/colour/im_Lab2XYZ.c @@ -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 ); } diff --git a/libsrc/colour/im_XYZ2Lab.c b/libsrc/colour/im_XYZ2Lab.c index 0646d94c..51c33cf5 100644 --- a/libsrc/colour/im_XYZ2Lab.c +++ b/libsrc/colour/im_XYZ2Lab.c @@ -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 ); } diff --git a/libsrc/colour/im_XYZ2disp.c b/libsrc/colour/im_XYZ2disp.c index fc254acf..335ff1c7 100644 --- a/libsrc/colour/im_XYZ2disp.c +++ b/libsrc/colour/im_XYZ2disp.c @@ -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 ); } diff --git a/libsrc/colour/im_disp2XYZ.c b/libsrc/colour/im_disp2XYZ.c index dceb02f3..5e692d8d 100644 --- a/libsrc/colour/im_disp2XYZ.c +++ b/libsrc/colour/im_disp2XYZ.c @@ -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 ); } diff --git a/libsrc/colour/im_icc_transform.c b/libsrc/colour/im_icc_transform.c index 609480ec..1357cde7 100644 --- a/libsrc/colour/im_icc_transform.c +++ b/libsrc/colour/im_icc_transform.c @@ -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 ); } diff --git a/libsrc/conversion/im_clip.c b/libsrc/conversion/im_clip.c index b10cc966..283647c6 100644 --- a/libsrc/conversion/im_clip.c +++ b/libsrc/conversion/im_clip.c @@ -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 ); } diff --git a/libsrc/conversion/im_copy.c b/libsrc/conversion/im_copy.c index 3c2db795..144fe8a6 100644 --- a/libsrc/conversion/im_copy.c +++ b/libsrc/conversion/im_copy.c @@ -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 ); } diff --git a/libsrc/conversion/im_extract.c b/libsrc/conversion/im_extract.c index 11bba3e3..26538eff 100644 --- a/libsrc/conversion/im_extract.c +++ b/libsrc/conversion/im_extract.c @@ -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 ); } } diff --git a/libsrc/conversion/im_falsecolour.c b/libsrc/conversion/im_falsecolour.c index 5b4112b6..a8e8a818 100644 --- a/libsrc/conversion/im_falsecolour.c +++ b/libsrc/conversion/im_falsecolour.c @@ -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 ); } diff --git a/libsrc/conversion/im_fliphor.c b/libsrc/conversion/im_fliphor.c index a93e4ff4..f5772260 100644 --- a/libsrc/conversion/im_fliphor.c +++ b/libsrc/conversion/im_fliphor.c @@ -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 ); } diff --git a/libsrc/conversion/im_gbandjoin.c b/libsrc/conversion/im_gbandjoin.c index 4fee6e4d..374baab4 100644 --- a/libsrc/conversion/im_gbandjoin.c +++ b/libsrc/conversion/im_gbandjoin.c @@ -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 ); } } diff --git a/libsrc/conversion/im_grid.c b/libsrc/conversion/im_grid.c index 56fe31ae..edb9befb 100644 --- a/libsrc/conversion/im_grid.c +++ b/libsrc/conversion/im_grid.c @@ -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 ); } diff --git a/libsrc/conversion/im_insert.c b/libsrc/conversion/im_insert.c index 760eedb7..f52cf6a6 100644 --- a/libsrc/conversion/im_insert.c +++ b/libsrc/conversion/im_insert.c @@ -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 ); } diff --git a/libsrc/conversion/im_msb.c b/libsrc/conversion/im_msb.c index 42f0b507..99d57f50 100644 --- a/libsrc/conversion/im_msb.c +++ b/libsrc/conversion/im_msb.c @@ -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; } diff --git a/libsrc/conversion/im_rightshift_size.c b/libsrc/conversion/im_rightshift_size.c index 1b21de29..48129e59 100644 --- a/libsrc/conversion/im_rightshift_size.c +++ b/libsrc/conversion/im_rightshift_size.c @@ -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; } } diff --git a/libsrc/conversion/im_rot180.c b/libsrc/conversion/im_rot180.c index f4bbb738..0450f70b 100644 --- a/libsrc/conversion/im_rot180.c +++ b/libsrc/conversion/im_rot180.c @@ -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 ) ) diff --git a/libsrc/conversion/im_rot270.c b/libsrc/conversion/im_rot270.c index 90bed5d1..61e94579 100644 --- a/libsrc/conversion/im_rot270.c +++ b/libsrc/conversion/im_rot270.c @@ -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 ) ) diff --git a/libsrc/conversion/im_rot90.c b/libsrc/conversion/im_rot90.c index 9c18c99d..0126aeb1 100644 --- a/libsrc/conversion/im_rot90.c +++ b/libsrc/conversion/im_rot90.c @@ -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 ) ) diff --git a/libsrc/conversion/im_subsample.c b/libsrc/conversion/im_subsample.c index 2e9e41d7..a3d00cf5 100644 --- a/libsrc/conversion/im_subsample.c +++ b/libsrc/conversion/im_subsample.c @@ -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 ); } diff --git a/libsrc/conversion/im_text.c b/libsrc/conversion/im_text.c index 37427e41..f381def7 100644 --- a/libsrc/conversion/im_text.c +++ b/libsrc/conversion/im_text.c @@ -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 ); } diff --git a/libsrc/conversion/im_vips2mask.c b/libsrc/conversion/im_vips2mask.c index 49c33b0d..7d92b6ac 100644 --- a/libsrc/conversion/im_vips2mask.c +++ b/libsrc/conversion/im_vips2mask.c @@ -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 ); } diff --git a/libsrc/conversion/im_zoom.c b/libsrc/conversion/im_zoom.c index b1ac52c0..0505f0d0 100644 --- a/libsrc/conversion/im_zoom.c +++ b/libsrc/conversion/im_zoom.c @@ -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 ); diff --git a/libsrc/convolution/im_contrast_surface.c b/libsrc/convolution/im_contrast_surface.c index 3b0a1d88..14c291c1 100644 --- a/libsrc/convolution/im_contrast_surface.c +++ b/libsrc/convolution/im_contrast_surface.c @@ -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; } diff --git a/libsrc/convolution/im_convf.c b/libsrc/convolution/im_convf.c index aa61b269..342b1234 100644 --- a/libsrc/convolution/im_convf.c +++ b/libsrc/convolution/im_convf.c @@ -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 ); } diff --git a/libsrc/convolution/im_convsep.c b/libsrc/convolution/im_convsep.c index 3afabff8..1606c939 100644 --- a/libsrc/convolution/im_convsep.c +++ b/libsrc/convolution/im_convsep.c @@ -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 ); } diff --git a/libsrc/convolution/im_convsepf.c b/libsrc/convolution/im_convsepf.c index 2a71bbe3..92cf5e4e 100644 --- a/libsrc/convolution/im_convsepf.c +++ b/libsrc/convolution/im_convsepf.c @@ -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 ); } diff --git a/libsrc/convolution/im_embed.c b/libsrc/convolution/im_embed.c index aee10c40..1485c5ef 100644 --- a/libsrc/convolution/im_embed.c +++ b/libsrc/convolution/im_embed.c @@ -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 ); } diff --git a/libsrc/convolution/im_sharpen.c b/libsrc/convolution/im_sharpen.c index e30fb7c3..bc7d24eb 100644 --- a/libsrc/convolution/im_sharpen.c +++ b/libsrc/convolution/im_sharpen.c @@ -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 ); } diff --git a/libsrc/convolution/im_shrink.c b/libsrc/convolution/im_shrink.c index 9581a01e..101041a8 100644 --- a/libsrc/convolution/im_shrink.c +++ b/libsrc/convolution/im_shrink.c @@ -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 ); } diff --git a/libsrc/convolution/im_spcor.c b/libsrc/convolution/im_spcor.c index 9de590c9..101f072b 100644 --- a/libsrc/convolution/im_spcor.c +++ b/libsrc/convolution/im_spcor.c @@ -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 ); } diff --git a/libsrc/convolution/im_stretch3.c b/libsrc/convolution/im_stretch3.c index bbd85561..dcc1eaaa 100644 --- a/libsrc/convolution/im_stretch3.c +++ b/libsrc/convolution/im_stretch3.c @@ -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 ) ) diff --git a/libsrc/convolution/im_zerox.c b/libsrc/convolution/im_zerox.c index 675e5efb..74fff483 100644 --- a/libsrc/convolution/im_zerox.c +++ b/libsrc/convolution/im_zerox.c @@ -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 ) ) diff --git a/libsrc/convolution/rw_mask.c b/libsrc/convolution/rw_mask.c index 7abffbbc..1839e999 100644 --- a/libsrc/convolution/rw_mask.c +++ b/libsrc/convolution/rw_mask.c @@ -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 ); } diff --git a/libsrc/format/im_analyze2vips.c b/libsrc/format/im_analyze2vips.c index f7ef0f48..4c19367b 100644 --- a/libsrc/format/im_analyze2vips.c +++ b/libsrc/format/im_analyze2vips.c @@ -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 ); } diff --git a/libsrc/format/im_csv2vips.c b/libsrc/format/im_csv2vips.c index 6f04c3a8..1383a71a 100644 --- a/libsrc/format/im_csv2vips.c +++ b/libsrc/format/im_csv2vips.c @@ -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 ) diff --git a/libsrc/format/im_jpeg2vips.c b/libsrc/format/im_jpeg2vips.c index 095c95ea..36e98753 100644 --- a/libsrc/format/im_jpeg2vips.c +++ b/libsrc/format/im_jpeg2vips.c @@ -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 ) { diff --git a/libsrc/format/im_magick2vips.c b/libsrc/format/im_magick2vips.c index 5c267d33..cf39d62a 100644 --- a/libsrc/format/im_magick2vips.c +++ b/libsrc/format/im_magick2vips.c @@ -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 ); } diff --git a/libsrc/format/im_png2vips.c b/libsrc/format/im_png2vips.c index 0e8b15f2..ff72dfb7 100644 --- a/libsrc/format/im_png2vips.c +++ b/libsrc/format/im_png2vips.c @@ -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 ); } diff --git a/libsrc/format/im_ppm2vips.c b/libsrc/format/im_ppm2vips.c index 1b9d2493..c2ef0569 100644 --- a/libsrc/format/im_ppm2vips.c +++ b/libsrc/format/im_ppm2vips.c @@ -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 ); } diff --git a/libsrc/format/im_tiff2vips.c b/libsrc/format/im_tiff2vips.c index 4561bf46..564f4155 100644 --- a/libsrc/format/im_tiff2vips.c +++ b/libsrc/format/im_tiff2vips.c @@ -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 ); } diff --git a/libsrc/format/im_tile_cache.c b/libsrc/format/im_tile_cache.c index 1ce3dd16..ac3a985e 100644 --- a/libsrc/format/im_tile_cache.c +++ b/libsrc/format/im_tile_cache.c @@ -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 ) ) diff --git a/libsrc/format/im_vips2csv.c b/libsrc/format/im_vips2csv.c index 6d19f9dd..74dc0340 100644 --- a/libsrc/format/im_vips2csv.c +++ b/libsrc/format/im_vips2csv.c @@ -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 ); } diff --git a/libsrc/format/im_vips2jpeg.c b/libsrc/format/im_vips2jpeg.c index 18e3d57f..49095076 100644 --- a/libsrc/format/im_vips2jpeg.c +++ b/libsrc/format/im_vips2jpeg.c @@ -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 ); } diff --git a/libsrc/format/im_vips2png.c b/libsrc/format/im_vips2png.c index f66803c5..2f44a6c7 100644 --- a/libsrc/format/im_vips2png.c +++ b/libsrc/format/im_vips2png.c @@ -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 ); } diff --git a/libsrc/format/im_vips2ppm.c b/libsrc/format/im_vips2ppm.c index 073a8d9f..6dad5da1 100644 --- a/libsrc/format/im_vips2ppm.c +++ b/libsrc/format/im_vips2ppm.c @@ -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 ); } diff --git a/libsrc/format/im_vips2tiff.c b/libsrc/format/im_vips2tiff.c index 209b8acb..7e105606 100644 --- a/libsrc/format/im_vips2tiff.c +++ b/libsrc/format/im_vips2tiff.c @@ -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 ); } } diff --git a/libsrc/freq_filt/im_fwfft.c b/libsrc/freq_filt/im_fwfft.c index b828308a..2f568e13 100644 --- a/libsrc/freq_filt/im_fwfft.c +++ b/libsrc/freq_filt/im_fwfft.c @@ -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 ); } diff --git a/libsrc/freq_filt/im_invfft.c b/libsrc/freq_filt/im_invfft.c index 289e7119..4b773859 100644 --- a/libsrc/freq_filt/im_invfft.c +++ b/libsrc/freq_filt/im_invfft.c @@ -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 ); } diff --git a/libsrc/freq_filt/im_invfftr.c b/libsrc/freq_filt/im_invfftr.c index 2d458d46..314bbf5f 100644 --- a/libsrc/freq_filt/im_invfftr.c +++ b/libsrc/freq_filt/im_invfftr.c @@ -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 ); } diff --git a/libsrc/histograms_lut/im_buildlut.c b/libsrc/histograms_lut/im_buildlut.c index 5c878936..7654d5c9 100644 --- a/libsrc/histograms_lut/im_buildlut.c +++ b/libsrc/histograms_lut/im_buildlut.c @@ -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 ); } diff --git a/libsrc/histograms_lut/im_histeq.c b/libsrc/histograms_lut/im_histeq.c index 3a3b4b63..03708c95 100644 --- a/libsrc/histograms_lut/im_histeq.c +++ b/libsrc/histograms_lut/im_histeq.c @@ -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 ) ) diff --git a/libsrc/histograms_lut/im_histgr.c b/libsrc/histograms_lut/im_histgr.c index ee9d7c64..a1b1422d 100644 --- a/libsrc/histograms_lut/im_histgr.c +++ b/libsrc/histograms_lut/im_histgr.c @@ -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 ) diff --git a/libsrc/histograms_lut/im_histnD.c b/libsrc/histograms_lut/im_histnD.c index 5ecbff51..d9983d49 100644 --- a/libsrc/histograms_lut/im_histnD.c +++ b/libsrc/histograms_lut/im_histnD.c @@ -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 ); } diff --git a/libsrc/histograms_lut/im_histplot.c b/libsrc/histograms_lut/im_histplot.c index fb64de3d..2941219d 100644 --- a/libsrc/histograms_lut/im_histplot.c +++ b/libsrc/histograms_lut/im_histplot.c @@ -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 ); } diff --git a/libsrc/histograms_lut/im_lhisteq.c b/libsrc/histograms_lut/im_lhisteq.c index 027d53d4..94b1d443 100644 --- a/libsrc/histograms_lut/im_lhisteq.c +++ b/libsrc/histograms_lut/im_lhisteq.c @@ -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 ) ) diff --git a/libsrc/histograms_lut/im_maplut.c b/libsrc/histograms_lut/im_maplut.c index 2430d0cf..d8992da6 100644 --- a/libsrc/histograms_lut/im_maplut.c +++ b/libsrc/histograms_lut/im_maplut.c @@ -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 ); } diff --git a/libsrc/histograms_lut/im_project.c b/libsrc/histograms_lut/im_project.c index 9d099890..e00daaac 100644 --- a/libsrc/histograms_lut/im_project.c +++ b/libsrc/histograms_lut/im_project.c @@ -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 ); } diff --git a/libsrc/histograms_lut/tone.c b/libsrc/histograms_lut/tone.c index e0016d97..0466a5dc 100644 --- a/libsrc/histograms_lut/tone.c +++ b/libsrc/histograms_lut/tone.c @@ -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 ); } diff --git a/libsrc/inplace/im_flood.c b/libsrc/inplace/im_flood.c index 9254b649..2e4d53d8 100644 --- a/libsrc/inplace/im_flood.c +++ b/libsrc/inplace/im_flood.c @@ -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 )) ) diff --git a/libsrc/inplace/im_insertplace.c b/libsrc/inplace/im_insertplace.c index 46cc1d6a..d78adf2d 100644 --- a/libsrc/inplace/im_insertplace.c +++ b/libsrc/inplace/im_insertplace.c @@ -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 ); } diff --git a/libsrc/inplace/im_plotmask.c b/libsrc/inplace/im_plotmask.c index c171086e..33b3ab98 100644 --- a/libsrc/inplace/im_plotmask.c +++ b/libsrc/inplace/im_plotmask.c @@ -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 ); } } diff --git a/libsrc/inplace/inplace_dispatch.c b/libsrc/inplace/inplace_dispatch.c index 8c5557c7..07838f25 100644 --- a/libsrc/inplace/inplace_dispatch.c +++ b/libsrc/inplace/inplace_dispatch.c @@ -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 )) ) diff --git a/libsrc/inplace/line_draw.c b/libsrc/inplace/line_draw.c index c83ea94c..a3f4fc38 100644 --- a/libsrc/inplace/line_draw.c +++ b/libsrc/inplace/line_draw.c @@ -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 ); } diff --git a/libsrc/inplace/smudge_area.c b/libsrc/inplace/smudge_area.c index 73730fa9..8c534c21 100644 --- a/libsrc/inplace/smudge_area.c +++ b/libsrc/inplace/smudge_area.c @@ -182,7 +182,7 @@ im_smudge( IMAGE *im, int ix, int iy, Rect *r ) break; default: - im_error( "im_smudge", _( "unknown band format" ) ); + im_error( "im_smudge", "%s", _( "unknown band format" ) ); return( -1 ); } @@ -309,7 +309,7 @@ im_smear( IMAGE *im, int ix, int iy, Rect *r ) break; default: - im_error( "im_smear", _( "unknown band format" ) ); + im_error( "im_smear", "%s", _( "unknown band format" ) ); return( -1 ); } diff --git a/libsrc/iofuncs/base64.c b/libsrc/iofuncs/base64.c index d0479229..a8b6169a 100644 --- a/libsrc/iofuncs/base64.c +++ b/libsrc/iofuncs/base64.c @@ -165,13 +165,13 @@ im__b64_encode( const unsigned char *data, size_t data_length ) int cursor; if( data_length <= 0 ) { - im_error( "im__b64_encode", _( "too little data" ) ); + im_error( "im__b64_encode", "%s", _( "too little data" ) ); return( NULL ); } if( output_data_length > 1024 * 1024 ) { /* We shouldn't really be used for large amounts of data. */ - im_error( "im__b64_encode", _( "too much data" ) ); + im_error( "im__b64_encode", "%s", _( "too much data" ) ); return( NULL ); } if( !(buffer = im_malloc( NULL, output_data_length )) ) @@ -236,7 +236,7 @@ im__b64_decode( const char *buffer, size_t *data_length ) if( output_data_length > 1024 * 1024 ) { /* We shouldn't really be used for large amounts of data. */ - im_error( "im__b64_decode", _( "too much data" ) ); + im_error( "im__b64_decode", "%s", _( "too much data" ) ); return( NULL ); } diff --git a/libsrc/iofuncs/dispatch_types.c b/libsrc/iofuncs/dispatch_types.c index 692cd4d0..edf7c65b 100644 --- a/libsrc/iofuncs/dispatch_types.c +++ b/libsrc/iofuncs/dispatch_types.c @@ -70,7 +70,8 @@ input_display_init( im_object *obj, char *str ) im_error( "input_display", _( "unknown display type \"%s\"" ), str ); - im_error( "input_display", _( "display should be one of:\n" ) ); + im_error( "input_display", + "%s", _( "display should be one of:\n" ) ); for( i = 0; (scr = im_col_displays( i )); i++ ) im_error( "input_display", " '%s'\n", scr->d_name ); @@ -597,7 +598,8 @@ input_int_init( im_object *obj, char *str ) int *i = (int *) *obj; if( sscanf( str, "%d", i ) != 1 ) { - im_error( "input_int", _( "bad format" ) ); + im_error( "input_int", + "%s", _( "bad format" ) ); return( -1 ); } diff --git a/libsrc/iofuncs/im_binfile.c b/libsrc/iofuncs/im_binfile.c index e55f7156..2702f3be 100644 --- a/libsrc/iofuncs/im_binfile.c +++ b/libsrc/iofuncs/im_binfile.c @@ -89,7 +89,8 @@ im_binfile( const char *name, int xs, int ys, int bands, int offset ) /* Check parameters. */ if( xs <= 0 || ys <= 0 || bands <=0 ) { - im_error( "im_binfile", _( "bad parameters" ) ); + im_error( "im_binfile", + "%s", _( "bad parameters" ) ); return( NULL ); } diff --git a/libsrc/iofuncs/im_cp_desc.c b/libsrc/iofuncs/im_cp_desc.c index 94e42ec9..8d72e01a 100644 --- a/libsrc/iofuncs/im_cp_desc.c +++ b/libsrc/iofuncs/im_cp_desc.c @@ -137,7 +137,8 @@ im_cp_descv( IMAGE *out, IMAGE *in1, ... ) ; va_end( ap ); if( i == MAX_IMAGES ) { - im_error( "im_cp_descv", _( "too many images" ) ); + im_error( "im_cp_descv", + "%s", _( "too many images" ) ); return( -1 ); } diff --git a/libsrc/iofuncs/im_demand_hint.c b/libsrc/iofuncs/im_demand_hint.c index 628e4fd2..ab901d6c 100644 --- a/libsrc/iofuncs/im_demand_hint.c +++ b/libsrc/iofuncs/im_demand_hint.c @@ -180,7 +180,8 @@ im_demand_hint( IMAGE *im, im_demand_type hint, ... ) ; va_end( ap ); if( i == MAX_IMAGES ) { - im_error( "im_demand_hint", _( "too many images" ) ); + im_error( "im_demand_hint", + "%s", _( "too many images" ) ); return( -1 ); } diff --git a/libsrc/iofuncs/im_generate.c b/libsrc/iofuncs/im_generate.c index f835f5e6..553feadd 100644 --- a/libsrc/iofuncs/im_generate.c +++ b/libsrc/iofuncs/im_generate.c @@ -378,7 +378,8 @@ im_generate( IMAGE *im, g_assert( !im_image_sanity( im ) ); if( im->Xsize <= 0 || im->Ysize <= 0 || im->Bands <= 0 ) { - im_error( "im_generate", _( "bad dimensions" ) ); + im_error( "im_generate", + "%s", _( "bad dimensions" ) ); return( -1 ); } @@ -389,7 +390,8 @@ im_generate( IMAGE *im, /* Output to partial image. Just attach functions and return. */ if( im->generate || im->start || im->stop ) { - im_error( "im_generate", _( "func already attached" ) ); + im_error( "im_generate", + "%s", _( "func already attached" ) ); return( -1 ); } @@ -412,7 +414,8 @@ im_generate( IMAGE *im, /* Eval now .. sanity check. */ if( im->generate || im->start || im->stop ) { - im_error( "im_generate", _( "func already attached" ) ); + im_error( "im_generate", + "%s", _( "func already attached" ) ); return( -1 ); } diff --git a/libsrc/iofuncs/im_iocheck.c b/libsrc/iofuncs/im_iocheck.c index 1407e4dc..61c6ecb7 100644 --- a/libsrc/iofuncs/im_iocheck.c +++ b/libsrc/iofuncs/im_iocheck.c @@ -159,7 +159,8 @@ im_incheck( IMAGE *im ) /* Should have been written to. */ if( !im->data ) { - im_error( "im_incheck", _( "no image data" ) ); + im_error( "im_incheck", + "%s", _( "no image data" ) ); return( -1 ); } @@ -211,7 +212,8 @@ im_incheck( IMAGE *im ) break; default: - im_error( "im_incheck", _( "image not readable" ) ); + im_error( "im_incheck", + "%s", _( "image not readable" ) ); return( -1 ); } @@ -232,7 +234,8 @@ im_outcheck( IMAGE *im ) /* Make sure nothing is attached. */ if( im->generate ) { - im_error( "im_outcheck", _( "image already written" ) ); + im_error( "im_outcheck", + "%s", _( "image already written" ) ); return( -1 ); } @@ -247,7 +250,8 @@ im_outcheck( IMAGE *im ) /* Check that it has not been im_setupout(). */ if( im->data ) { - im_error( "im_outcheck", _( "image already written" ) ); + im_error( "im_outcheck", + "%s", _( "image already written" ) ); return( -1 ); } @@ -260,7 +264,8 @@ im_outcheck( IMAGE *im ) break; default: - im_error( "im_outcheck", _( "image not writeable" ) ); + im_error( "im_outcheck", + "%s", _( "image not writeable" ) ); return( -1 ); } @@ -282,7 +287,8 @@ im_rwcheck( IMAGE *im ) * generate im_partial() files. */ if( im_incheck( im ) ) { - im_error( "im_rwcheck", _( "unable to rewind file" ) ); + im_error( "im_rwcheck", + "%s", _( "unable to rewind file" ) ); return( -1 ); } @@ -305,7 +311,8 @@ im_rwcheck( IMAGE *im ) break; default: - im_error( "im_rwcheck", _( "bad file type" ) ); + im_error( "im_rwcheck", + "%s", _( "bad file type" ) ); return( -1 ); } diff --git a/libsrc/iofuncs/im_mapfile.c b/libsrc/iofuncs/im_mapfile.c index cce255fc..889c0ac6 100644 --- a/libsrc/iofuncs/im_mapfile.c +++ b/libsrc/iofuncs/im_mapfile.c @@ -137,7 +137,7 @@ im__mmap( int fd, int writeable, size_t length, gint64 offset ) if( !(hMMFile = CreateFileMapping( hFile, NULL, flProtect, 0, 0, NULL )) ) { im_error_system( GetLastError(), "im_mapfile", - _( "unable to CreateFileMapping" ) ); + "%s", _( "unable to CreateFileMapping" ) ); return( NULL ); } @@ -147,7 +147,7 @@ im__mmap( int fd, int writeable, size_t length, gint64 offset ) if( !(baseaddr = (char *)MapViewOfFile( hMMFile, dwDesiredAccess, dwFileOffsetHigh, dwFileOffsetLow, length )) ) { im_error_system( GetLastError(), "im_mapfile", - _( "unable to MapViewOfFile" ) ); + "%s", _( "unable to MapViewOfFile" ) ); CloseHandle( hMMFile ); return( NULL ); } @@ -174,7 +174,8 @@ im__mmap( int fd, int writeable, size_t length, gint64 offset ) baseaddr = mmap( 0, length, prot, MAP_SHARED, fd, (off_t) offset ); if( baseaddr == MAP_FAILED ) { - im_error_system( errno, "im_mapfile", _( "unable to mmap" ) ); + im_error_system( errno, "im_mapfile", + "%s", _( "unable to mmap" ) ); im_warn( "im_mapfile", _( "map failed (%s), " "running very low on system resources, " "expect a crash soon" ), strerror( errno ) ); @@ -192,13 +193,13 @@ im__munmap( void *start, size_t length ) #ifdef OS_WIN32 if( !UnmapViewOfFile( start ) ) { im_error_system( GetLastError(), "im_mapfile", - _( "unable to UnmapViewOfFile" ) ); + "%s", _( "unable to UnmapViewOfFile" ) ); return( -1 ); } #else /*!OS_WIN32*/ if( munmap( start, length ) < 0 ) { im_error_system( errno, "im_mapfile", - _( "unable to munmap file" ) ); + "%s", _( "unable to munmap file" ) ); return( -1 ); } #endif /*OS_WIN32*/ @@ -221,16 +222,19 @@ im_mapfile( IMAGE *im ) if( (length = im_file_length( im->fd )) == -1 ) return( -1 ); if( fstat( im->fd, &st ) == -1 ) { - im_error( "im_mapfile", _( "unable to get file status" ) ); + im_error( "im_mapfile", + "%s", _( "unable to get file status" ) ); return( -1 ); } m = (mode_t) st.st_mode; if( length < 64 ) { - im_error( "im_mapfile", _( "file is less than 64 bytes" ) ); + im_error( "im_mapfile", + "%s", _( "file is less than 64 bytes" ) ); return( -1 ); } if( !S_ISREG( m ) ) { - im_error( "im_mapfile", _( "not a regular file" ) ); + im_error( "im_mapfile", + "%s", _( "not a regular file" ) ); return( -1 ); } @@ -262,12 +266,14 @@ im_mapfilerw( IMAGE *im ) if( (length = im_file_length( im->fd )) == -1 ) return( -1 ); if( fstat( im->fd, &st ) == -1 ) { - im_error( "im_mapfilerw", _( "unable to get file status" ) ); + im_error( "im_mapfilerw", + "%s", _( "unable to get file status" ) ); return( -1 ); } m = (mode_t) st.st_mode; if( length < 64 || !S_ISREG( m ) ) { - im_error( "im_mapfile", _( "unable to read data" ) ); + im_error( "im_mapfile", + "%s", _( "unable to read data" ) ); return( -1 ); } @@ -298,19 +304,19 @@ im_remapfilerw( IMAGE *image ) if( !(hMMFile = CreateFileMapping( hFile, NULL, PAGE_READWRITE, 0, 0, NULL )) ) { im_error_system( GetLastError(), "im_mapfile", - _( "unable to CreateFileMapping" ) ); + "%s", _( "unable to CreateFileMapping" ) ); return( -1 ); } if( !UnmapViewOfFile( image->baseaddr ) ) { im_error_system( GetLastError(), "im_mapfile", - _( "unable to UnmapViewOfFile" ) ); + "%s", _( "unable to UnmapViewOfFile" ) ); return( -1 ); } if( !(baseaddr = (char *)MapViewOfFileEx( hMMFile, FILE_MAP_WRITE, 0, 0, 0, image->baseaddr )) ) { im_error_system( GetLastError(), "im_mapfile", - _( "unable to MapViewOfFile" ) ); + "%s", _( "unable to MapViewOfFile" ) ); CloseHandle( hMMFile ); return( -1 ); } diff --git a/libsrc/iofuncs/im_open.c b/libsrc/iofuncs/im_open.c index de43ebc1..abf19515 100644 --- a/libsrc/iofuncs/im_open.c +++ b/libsrc/iofuncs/im_open.c @@ -354,7 +354,7 @@ im_open( const char *filename, const char *mode ) im_error_clear(); if( !filename || !mode ) { - im_error( "im_open", _( "NULL filename or mode" ) ); + im_error( "im_open", "%s", _( "NULL filename or mode" ) ); return( NULL ); } diff --git a/libsrc/iofuncs/im_open_vips.c b/libsrc/iofuncs/im_open_vips.c index 6faa2045..a33123d2 100644 --- a/libsrc/iofuncs/im_open_vips.c +++ b/libsrc/iofuncs/im_open_vips.c @@ -310,7 +310,7 @@ read_chunk( int fd, gint64 offset, size_t length ) return( NULL ); if( read( fd, buf, length ) != length ) { im_free( buf ); - im_error( "im_readhist", _( "unable to read history" ) ); + im_error( "im_readhist", "%s", _( "unable to read history" ) ); return( NULL ); } buf[length] = '\0'; @@ -347,7 +347,7 @@ im__read_extension_block( IMAGE *im, int *size ) return( NULL ); if( length - psize > 10 * 1024 * 1024 ) { im_error( "im_readhist", - _( "more than a 10 megabytes of XML? " + "%s", _( "more than a 10 megabytes of XML? " "sufferin' succotash!" ) ); return( NULL ); } @@ -394,7 +394,8 @@ read_xml( IMAGE *im ) if( !(node = xmlDocGetRootElement( doc )) || !node->nsDef || !im_isprefix( NAMESPACE, (char *) node->nsDef->href ) ) { - im_error( "im__readhist", _( "incorrect namespace in XML" ) ); + im_error( "im__readhist", + "%s", _( "incorrect namespace in XML" ) ); xmlFreeDoc( doc ); return( NULL ); } @@ -515,8 +516,9 @@ rebuild_header_meta( IMAGE *im, xmlNode *i ) g_value_init( &value, gtype ); if( !g_value_transform( &save_value, &value ) ) { g_value_unset( &save_value ); - im_error( "im__readhist", _( "error " - "transforming from save format" ) ); + im_error( "im__readhist", + "%s", _( "error transforming from " + "save format" ) ); return( -1 ); } if( im_meta_set( im, name, &value ) ) { @@ -670,7 +672,7 @@ save_fields_meta( Meta *meta, xmlNode *node ) g_value_init( &save_value, IM_TYPE_SAVE_STRING ); if( !g_value_transform( &meta->value, &save_value ) ) { - im_error( "im__writehist", + im_error( "im__writehist", "%s", _( "error transforming to save format" ) ); return( node ); } @@ -719,7 +721,7 @@ im__write_extension_block( IMAGE *im, void *buf, int size ) return( -1 ); if( length - psize < 0 ) { im_error( "im__write_extension_block", - _( "file has been truncated" ) ); + "%s", _( "file has been truncated" ) ); return( -1 ); } @@ -833,7 +835,7 @@ im__writehist( IMAGE *im ) NULL, (xmlChar *) "root", NULL )) || set_sprop( doc->children, "xmlns", namespace ) || save_fields( im, doc->children ) ) { - im_error( "im__writehist", _( "xml save error" ) ); + im_error( "im__writehist", "%s", _( "xml save error" ) ); xmlFreeDoc( doc ); return( -1 ); } @@ -842,7 +844,7 @@ im__writehist( IMAGE *im ) */ xmlDocDumpMemory( doc, (xmlChar **) ((char *) &dump), &dump_size ); if( !dump ) { - im_error( "im__writehist", _( "xml save error" ) ); + im_error( "im__writehist", "%s", _( "xml save error" ) ); xmlFreeDoc( doc ); return( -1 ); } @@ -865,7 +867,7 @@ im__writehist( IMAGE *im ) xmlDocDumpMemory( doc, (xmlChar **) &dump2, &dump_size2 ); if( !dump2 ) { - im_error( "im__writehist", _( "xml save error" ) ); + im_error( "im__writehist", "%s", _( "xml save error" ) ); xmlFreeDoc( doc ); xmlFree( dump ); return( -1 ); @@ -1022,7 +1024,8 @@ im_open_vips( const char *filename ) if( im->Bbits != IM_BBITS_BYTE && im_isMSBfirst( im ) != im_amiMSBfirst() ) { im_close( im ); - im_error( "im_open_vips", _( "open for read-write for " + im_error( "im_open_vips", "%s", + _( "open for read-write for " "native format images only" ) ); return( NULL ); } @@ -1071,7 +1074,7 @@ im_open_vips( const char *filename ) default: im_close( im ); - im_error( "im_open", _( "unknown coding type" ) ); + im_error( "im_open", "%s", _( "unknown coding type" ) ); return( NULL ); } } diff --git a/libsrc/iofuncs/im_prepare.c b/libsrc/iofuncs/im_prepare.c index 6871eb56..7aa751a9 100644 --- a/libsrc/iofuncs/im_prepare.c +++ b/libsrc/iofuncs/im_prepare.c @@ -225,7 +225,8 @@ im_prepare_to_generate( REGION *reg, REGION *dest, Rect *r, int x, int y ) char *p; if( !im->generate ) { - im_error( "im_prepare_to", _( "incomplete header" ) ); + im_error( "im_prepare_to", + "%s", _( "incomplete header" ) ); return( -1 ); } @@ -273,7 +274,8 @@ im_prepare_to( REGION *reg, REGION *dest, Rect *r, int x, int y ) */ if( !dest->data || dest->im->BandFmt != reg->im->BandFmt || dest->im->Bands != reg->im->Bands ) { - im_error( "im_prepare_to", _( "inappropriate region type" ) ); + im_error( "im_prepare_to", + "%s", _( "inappropriate region type" ) ); return( -1 ); } @@ -298,7 +300,8 @@ im_prepare_to( REGION *reg, REGION *dest, Rect *r, int x, int y ) /* Test that dest->valid is large enough. */ if( !im_rect_includesrect( &dest->valid, &wanted ) ) { - im_error( "im_prepare_to", _( "dest too small" ) ); + im_error( "im_prepare_to", + "%s", _( "dest too small" ) ); return( -1 ); } @@ -315,7 +318,8 @@ im_prepare_to( REGION *reg, REGION *dest, Rect *r, int x, int y ) y = clipped2.top; if( im_rect_isempty( &final ) ) { - im_error( "im_prepare_to", _( "valid clipped to nothing" ) ); + im_error( "im_prepare_to", + "%s", _( "valid clipped to nothing" ) ); return( -1 ); } diff --git a/libsrc/iofuncs/im_printdesc.c b/libsrc/iofuncs/im_printdesc.c index cfed70e5..d162da9b 100644 --- a/libsrc/iofuncs/im_printdesc.c +++ b/libsrc/iofuncs/im_printdesc.c @@ -207,7 +207,7 @@ char2enum( EnumTable *etable, const char *name ) if( g_ascii_strcasecmp( etable->names[i], name ) == 0 ) return( i ); - im_error( "char2enum", _( etable->error ) ); + im_error( "char2enum", "%s", _( etable->error ) ); return( -1 ); } diff --git a/libsrc/iofuncs/im_render.c b/libsrc/iofuncs/im_render.c index ad0cac90..2c69e1b2 100644 --- a/libsrc/iofuncs/im_render.c +++ b/libsrc/iofuncs/im_render.c @@ -563,7 +563,8 @@ render_thread_create( void ) IM__DEFAULT_STACK_SIZE, TRUE, FALSE, G_THREAD_PRIORITY_NORMAL, NULL )) ) { im_free( thread ); - im_error( "im_render", _( "unable to create thread" ) ); + im_error( "im_render", + "%s", _( "unable to create thread" ) ); return( -1 ); } @@ -721,7 +722,8 @@ render_new( IMAGE *in, IMAGE *out, IMAGE *mask, render_fade, render, IM__DEFAULT_STACK_SIZE, TRUE, FALSE, G_THREAD_PRIORITY_NORMAL, NULL )) ) { - im_error( "im_render", _( "unable to create thread" ) ); + im_error( "im_render", + "%s", _( "unable to create thread" ) ); return( NULL ); } @@ -1182,7 +1184,8 @@ im_render_fade( IMAGE *in, IMAGE *out, IMAGE *mask, * time. */ if( width <= 0 || height <= 0 || max < -1 || fps <= 0 || steps < 0 ) { - im_error( "im_render", _( "bad parameters" ) ); + im_error( "im_render", + "%s", _( "bad parameters" ) ); return( -1 ); } if( im_pincheck( in ) || im_poutcheck( out ) ) diff --git a/libsrc/iofuncs/im_setupout.c b/libsrc/iofuncs/im_setupout.c index 83bb1d72..fefcc883 100644 --- a/libsrc/iofuncs/im_setupout.c +++ b/libsrc/iofuncs/im_setupout.c @@ -94,7 +94,8 @@ im_setupout( IMAGE *im ) g_assert( !im_image_sanity( im ) ); if( im->Xsize <= 0 || im->Ysize <= 0 || im->Bands <= 0 ) { - im_error( "im_setupout", _( "bad dimensions" ) ); + im_error( "im_setupout", + "%s", _( "bad dimensions" ) ); return( -1 ); } @@ -122,7 +123,8 @@ im_setupout( IMAGE *im ) if( im->data ) { /* Sanity failure! */ - im_error( "im_setupout", _( "called twice!" ) ); + im_error( "im_setupout", + "%s", _( "called twice!" ) ); return( -1 ); } if( !(im->data = im_malloc( NULL, @@ -152,7 +154,8 @@ im_setupout( IMAGE *im ) } default: - im_error( "im_setupout", _( "bad image descriptor" ) ); + im_error( "im_setupout", + "%s", _( "bad image descriptor" ) ); return( -1 ); } diff --git a/libsrc/iofuncs/im_wbuffer.c b/libsrc/iofuncs/im_wbuffer.c index 9b3a33c9..3bc984dc 100644 --- a/libsrc/iofuncs/im_wbuffer.c +++ b/libsrc/iofuncs/im_wbuffer.c @@ -173,7 +173,7 @@ wbuffer_new( im_threadgroup_t *tg, im_wbuffer_fn write_fn, void *a, void *b ) */ if( !(wbuffer->thread = g_thread_create( wbuffer_write_thread, wbuffer, TRUE, NULL )) ) { - im_error( "wbuffer_new", _( "unable to create thread" ) ); + im_error( "wbuffer_new", "%s", _( "unable to create thread" ) ); wbuffer_free( wbuffer ); return( NULL ); } @@ -354,7 +354,7 @@ wbuffer_eval_to_file( WriteBuffer *b1, WriteBuffer *b2 ) if( b2->write_errno ) { im_error_system( b2->write_errno, "im__eval_to_file", - _( "write failed" ) ); + "%s", _( "write failed" ) ); return( -1 ); } } @@ -391,7 +391,7 @@ wbuffer_eval_to_file( WriteBuffer *b1, WriteBuffer *b2 ) if( b1->write_errno || b2->write_errno ) { im_error_system( b1->write_errno ? b1->write_errno : b2->write_errno, - "im__eval_to_file", _( "write failed" ) ); + "im__eval_to_file", "%s", _( "write failed" ) ); return( -1 ); } diff --git a/libsrc/iofuncs/im_wrapmany.c b/libsrc/iofuncs/im_wrapmany.c index 039722d9..f250a5f0 100644 --- a/libsrc/iofuncs/im_wrapmany.c +++ b/libsrc/iofuncs/im_wrapmany.c @@ -163,7 +163,7 @@ im_wrapmany( IMAGE **in, IMAGE *out, im_wrapmany_fn fn, void *a, void *b ) for( n = 0; in[n]; n++ ) ; if( n >= IM_MAX_INPUT_IMAGES - 1 ) { - im_error( "im_wrapmany", _( "too many input images" ) ); + im_error( "im_wrapmany", "%s", _( "too many input images" ) ); return( -1 ); } @@ -181,7 +181,7 @@ im_wrapmany( IMAGE **in, IMAGE *out, im_wrapmany_fn fn, void *a, void *b ) for( i = 0; i < n; i++ ) { if( in[i]->Xsize != out->Xsize || in[i]->Ysize != out->Ysize ) { im_error( "im_wrapmany", - _( "descriptors differ in size" ) ); + "%s", _( "descriptors differ in size" ) ); return( -1 ); } diff --git a/libsrc/iofuncs/package.c b/libsrc/iofuncs/package.c index 518f8388..21b9056e 100644 --- a/libsrc/iofuncs/package.c +++ b/libsrc/iofuncs/package.c @@ -504,7 +504,7 @@ im_load_plugin( const char *name ) if( !g_module_supported() ) { im_error( "plugin", - _( "plugins not supported on this platform" ) ); + "%s", _( "plugins not supported on this platform" ) ); return( NULL ); } @@ -839,7 +839,7 @@ build_args( im_function *fn, im_object *vargv, int argc, char **argv ) if( type->flags & IM_TYPE_ARG ) { if( !argv[j] ) { im_error( "im_run_command", - _( "too few arguments" ) ); + "%s", _( "too few arguments" ) ); return( -1 ); } str = argv[j++]; @@ -860,7 +860,7 @@ build_args( im_function *fn, im_object *vargv, int argc, char **argv ) /* Have we used up all the command-line args? */ if( argv[j] ) { - im_error( "im_run_command", _( "too many arguments" ) ); + im_error( "im_run_command", "%s", _( "too many arguments" ) ); return( -1 ); } @@ -1077,7 +1077,7 @@ im_version( int flag ) return( IM_MICRO_VERSION ); default: - im_error( "im_version", _( "flag not 0,1,2" ) ); + im_error( "im_version", "%s", _( "flag not 0,1,2" ) ); return( -1 ); } } diff --git a/libsrc/iofuncs/region.c b/libsrc/iofuncs/region.c index 7b2868de..b7a140df 100644 --- a/libsrc/iofuncs/region.c +++ b/libsrc/iofuncs/region.c @@ -335,7 +335,8 @@ im_region_buffer( REGION *reg, Rect *r ) /* Test for empty. */ if( im_rect_isempty( &clipped ) ) { - im_error( "im_region_buffer", _( "valid clipped to nothing" ) ); + im_error( "im_region_buffer", + "%s", _( "valid clipped to nothing" ) ); return( -1 ); } @@ -389,7 +390,8 @@ im_region_image( REGION *reg, Rect *r ) /* Test for empty. */ if( im_rect_isempty( &clipped ) ) { - im_error( "im_region_image", _( "valid clipped to nothing" ) ); + im_error( "im_region_image", + "%s", _( "valid clipped to nothing" ) ); return( -1 ); } @@ -434,7 +436,8 @@ im_region_image( REGION *reg, Rect *r ) reg->data = reg->window->data; } else { - im_error( "im_region_image", _( "bad image type" ) ); + im_error( "im_region_image", + "%s", _( "bad image type" ) ); return( -1 ); } @@ -469,7 +472,7 @@ im_region_region( REGION *reg, REGION *dest, Rect *r, int x, int y ) IM_IMAGE_SIZEOF_PEL( dest->im ) != IM_IMAGE_SIZEOF_PEL( reg->im ) ) { im_error( "im_region_region", - _( "inappropriate region type" ) ); + "%s", _( "inappropriate region type" ) ); return( -1 ); } im__region_check_ownership( reg ); @@ -501,7 +504,8 @@ im_region_region( REGION *reg, REGION *dest, Rect *r, int x, int y ) /* Test that dest->valid is large enough. */ if( !im_rect_includesrect( &dest->valid, &wanted ) ) { - im_error( "im_region_region", _( "dest too small" ) ); + im_error( "im_region_region", + "%s", _( "dest too small" ) ); return( -1 ); } @@ -519,7 +523,8 @@ im_region_region( REGION *reg, REGION *dest, Rect *r, int x, int y ) /* Test for empty. */ if( im_rect_isempty( &final ) ) { - im_error( "im_region_region", _( "valid clipped to nothing" ) ); + im_error( "im_region_region", + "%s", _( "valid clipped to nothing" ) ); return( -1 ); } @@ -569,7 +574,8 @@ im_region_position( REGION *reg, int x, int y ) req.height = reg->valid.height; im_rect_intersectrect( &image, &req, &clipped ); if( x < 0 || y < 0 || im_rect_isempty( &clipped ) ) { - im_error( "im_region_position", _( "bad position" ) ); + im_error( "im_region_position", + "%s", _( "bad position" ) ); return( -1 ); } diff --git a/libsrc/iofuncs/threadgroup.c b/libsrc/iofuncs/threadgroup.c index ca103b00..f22db197 100644 --- a/libsrc/iofuncs/threadgroup.c +++ b/libsrc/iofuncs/threadgroup.c @@ -466,7 +466,7 @@ threadgroup_thread_new( im_threadgroup_t *tg ) IM__DEFAULT_STACK_SIZE, TRUE, FALSE, G_THREAD_PRIORITY_NORMAL, NULL )) ) { im_error( "threadgroup_thread_new", - _( "unable to create thread" ) ); + "%s", _( "unable to create thread" ) ); thread_free( thr ); return( NULL ); } diff --git a/libsrc/iofuncs/util.c b/libsrc/iofuncs/util.c index 616a1956..d8e31fc2 100644 --- a/libsrc/iofuncs/util.c +++ b/libsrc/iofuncs/util.c @@ -662,7 +662,7 @@ im_file_length( int fd ) if( fstat( fd, &st ) == -1 ) { #endif /*OS_WIN32*/ im_error_system( errno, "im_file_length", - _( "unable to get file stats" ) ); + "%s", _( "unable to get file stats" ) ); return( -1 ); } @@ -679,7 +679,7 @@ im__write( int fd, const void *buf, size_t count ) if( nwritten == (size_t) -1 ) { im_error_system( errno, "im__write", - _( "write failed" ) ); + "%s", _( "write failed" ) ); return( -1 ); } @@ -723,7 +723,7 @@ im__file_read( FILE *fp, const char *name, unsigned int *length_out ) size += 1024; if( !(str = realloc( str, size )) ) { im_error( "im__file_read", - _( "out of memory" ) ); + "%s", _( "out of memory" ) ); return( NULL ); } @@ -962,13 +962,13 @@ im__seek( int fd, gint64 pos ) p.QuadPart = pos; if( !SetFilePointerEx( hFile, p, NULL, FILE_BEGIN ) ) { im_error_system( GetLastError(), "im__seek", - _( "unable to seek" ) ); + "%s", _( "unable to seek" ) ); return( -1 ); } } #else /*!OS_WIN32*/ if( lseek( fd, pos, SEEK_SET ) == (off_t) -1 ) { - im_error( "im__seek", _( "unable to seek" ) ); + im_error( "im__seek", "%s", _( "unable to seek" ) ); return( -1 ); } #endif /*OS_WIN32*/ @@ -996,14 +996,14 @@ im__ftruncate( int fd, gint64 pos ) return( -1 ); if( !SetEndOfFile( hFile ) ) { im_error_system( GetLastError(), "im__ftruncate", - _( "unable to truncate" ) ); + "%s", _( "unable to truncate" ) ); return( -1 ); } } #else /*!OS_WIN32*/ if( ftruncate( fd, pos ) ) { im_error_system( errno, "im__ftruncate", - _( "unable to truncate" ) ); + "%s", _( "unable to truncate" ) ); return( -1 ); } #endif /*OS_WIN32*/ diff --git a/libsrc/morphology/im_dilate.c b/libsrc/morphology/im_dilate.c index cf410057..2f242d22 100644 --- a/libsrc/morphology/im_dilate.c +++ b/libsrc/morphology/im_dilate.c @@ -253,7 +253,7 @@ im_dilate_raw( IMAGE *in, IMAGE *out, INTMASK *m ) */ if( m->xsize < 1 || !(m->xsize & 0x1) || m->ysize < 1 || !(m->ysize & 0x1) ) { - im_error( "im_dilate", _( "mask size not odd" ) ); + im_error( "im_dilate", "%s", _( "mask size not odd" ) ); return( -1 ); } @@ -263,7 +263,7 @@ im_dilate_raw( IMAGE *in, IMAGE *out, INTMASK *m ) return( -1 ); if( in->Coding != IM_CODING_NONE || in->Bbits != 8 || in->BandFmt != IM_BANDFMT_UCHAR ) { - im_error( "im_dilate", _( "uchar uncoded only" ) ); + im_error( "im_dilate", "%s", _( "uchar uncoded only" ) ); return( -1 ); } if( im_cp_desc( out, in ) ) @@ -277,7 +277,7 @@ im_dilate_raw( IMAGE *in, IMAGE *out, INTMASK *m ) out->Xsize -= m->xsize - 1; out->Ysize -= m->ysize - 1; if( out->Xsize <= 0 || out->Ysize <= 0 ) { - im_error( "im_dilate", _( "image too small for mask" ) ); + im_error( "im_dilate", "%s", _( "image too small for mask" ) ); return( -1 ); } diff --git a/libsrc/morphology/im_erode.c b/libsrc/morphology/im_erode.c index bdf1db38..3320b902 100644 --- a/libsrc/morphology/im_erode.c +++ b/libsrc/morphology/im_erode.c @@ -249,7 +249,7 @@ im_erode_raw( IMAGE *in, IMAGE *out, INTMASK *m ) */ if( m->xsize < 1 || !(m->xsize & 0x1) || m->ysize < 1 || !(m->ysize & 0x1) ) { - im_error( "im_erode", _( "mask size not odd" ) ); + im_error( "im_erode", "%s", _( "mask size not odd" ) ); return( -1 ); } @@ -259,7 +259,7 @@ im_erode_raw( IMAGE *in, IMAGE *out, INTMASK *m ) return( -1 ); if( in->Coding != IM_CODING_NONE || in->Bbits != 8 || in->BandFmt != IM_BANDFMT_UCHAR ) { - im_error( "im_erode", _( "1-band uchar uncoded only" ) ); + im_error( "im_erode", "%s", _( "1-band uchar uncoded only" ) ); return( -1 ); } if( im_cp_desc( out, in ) ) @@ -273,7 +273,7 @@ im_erode_raw( IMAGE *in, IMAGE *out, INTMASK *m ) out->Xsize -= m->xsize - 1; out->Ysize -= m->ysize - 1; if( out->Xsize <= 0 || out->Ysize <= 0 ) { - im_error( "im_erode", _( "image too small for mask" ) ); + im_error( "im_erode", "%s", _( "image too small for mask" ) ); return( -1 ); } diff --git a/libsrc/mosaicing/global_balance.c b/libsrc/mosaicing/global_balance.c index df14ab84..7dac668f 100644 --- a/libsrc/mosaicing/global_balance.c +++ b/libsrc/mosaicing/global_balance.c @@ -143,7 +143,7 @@ break_items( char *line, char **out ) out[i] = line = p + 1; if( !(p = strchr( line, '>' )) ) { - im_error( "break_files", _( "no matching '>'" ) ); + im_error( "break_files", "%s", _( "no matching '>'" ) ); return( -1 ); } @@ -152,7 +152,7 @@ break_items( char *line, char **out ) } if( i == MAX_ITEMS ) { - im_error( "break_files", _( "too many items" ) ); + im_error( "break_files", "%s", _( "too many items" ) ); return( -1 ); } @@ -447,7 +447,8 @@ propogate_transform( JoinNode *node, Transformation *trn ) return( 0 ); if( node->dirty && node->arg1 && node->arg2 ) { - im_error( "im_global_balance", _( "circularity detected" ) ); + im_error( "im_global_balance", + "%s", _( "circularity detected" ) ); return( -1 ); } node->dirty = 1; @@ -586,7 +587,7 @@ process_line( SymbolTable *st, const char *text ) return( -1 ); if( nitems != 5 && nitems != 6 ) { im_error( "global_balance", - _( "bad number of args in join line" ) ); + "%s", _( "bad number of args in join line" ) ); return( -1 ); } @@ -628,7 +629,7 @@ process_line( SymbolTable *st, const char *text ) return( -1 ); if( nitems != 7 && nitems != 8 ) { im_error( "global_balance", - _( "bad number of args in join1 line" ) ); + "%s", _( "bad number of args in join1 line" ) ); return( -1 ); } @@ -664,7 +665,7 @@ process_line( SymbolTable *st, const char *text ) return( -1 ); if( nitems != 2 ) { im_error( "global_balance", - _( "bad number of args in copy line" ) ); + "%s", _( "bad number of args in copy line" ) ); return( -1 ); } @@ -722,7 +723,7 @@ find_root( SymbolTable *st ) */ if( !root ) { im_error( "im_global_balance", - _( "mosaic root not found in desc file\n" + "%s", _( "mosaic root not found in desc file\n" "is this really a mosaiced image?" ) ); return( NULL ); } @@ -732,7 +733,8 @@ find_root( SymbolTable *st ) */ root->dirty = 1; if( (notroot = im__map_table( st, is_root, NULL, NULL )) ) { - im_error( "im_global_balance", _( "more than one root" ) ); + im_error( "im_global_balance", + "%s", _( "more than one root" ) ); return( NULL ); } @@ -1069,7 +1071,7 @@ find_image_stats( IMAGE *in, IMAGE *mask, Rect *area ) #ifdef DEBUG if( count == 0 ) - im_warn( "global_balance", _( "empty overlap!" ) ); + im_warn( "global_balance", "%s", _( "empty overlap!" ) ); #endif /*DEBUG*/ return( stats ); diff --git a/libsrc/mosaicing/im_affine.c b/libsrc/mosaicing/im_affine.c index 8c77d30e..56d61f17 100644 --- a/libsrc/mosaicing/im_affine.c +++ b/libsrc/mosaicing/im_affine.c @@ -625,7 +625,8 @@ affine( IMAGE *in, IMAGE *out, Transformation *trn ) double edge; if( im_iscomplex( in ) ) { - im_error( "im_affine", _( "complex input not supported" ) ); + im_error( "im_affine", + "%s", _( "complex input not supported" ) ); return( -1 ); } @@ -668,7 +669,8 @@ affine( IMAGE *in, IMAGE *out, Transformation *trn ) if( trn2->oarea.left < -edge || trn2->oarea.top < -edge || IM_RECT_RIGHT( &trn2->oarea ) > edge || IM_RECT_BOTTOM( &trn2->oarea ) > edge ) { - im_error( "im_affine", _( "output coordinates out of range" ) ); + im_error( "im_affine", + "%s", _( "output coordinates out of range" ) ); return( -1 ); } @@ -728,7 +730,8 @@ im__affine( IMAGE *in, IMAGE *out, Transformation *trn ) return( -1 ); } else { - im_error( "im_affine", _( "unknown coding type" ) ); + im_error( "im_affine", + "%s", _( "unknown coding type" ) ); return( -1 ); } diff --git a/libsrc/mosaicing/im_affinei.c b/libsrc/mosaicing/im_affinei.c index 398bfc84..0e25f5e8 100644 --- a/libsrc/mosaicing/im_affinei.c +++ b/libsrc/mosaicing/im_affinei.c @@ -346,7 +346,8 @@ affinei( IMAGE *in, IMAGE *out, double edge; if( im_iscomplex( in ) ) { - im_error( "im_affinei", _( "complex input not supported" ) ); + im_error( "im_affinei", + "%s", _( "complex input not supported" ) ); return( -1 ); } @@ -402,7 +403,7 @@ affinei( IMAGE *in, IMAGE *out, IM_RECT_RIGHT( &affine->trn.oarea ) > edge || IM_RECT_BOTTOM( &affine->trn.oarea ) > edge ) { im_error( "im_affinei", - _( "output coordinates out of range" ) ); + "%s", _( "output coordinates out of range" ) ); return( -1 ); } @@ -459,7 +460,7 @@ im__affinei( IMAGE *in, IMAGE *out, return( -1 ); } else { - im_error( "im_affinei", _( "unknown coding type" ) ); + im_error( "im_affinei", "%s", _( "unknown coding type" ) ); return( -1 ); } diff --git a/libsrc/mosaicing/im_lrmerge.c b/libsrc/mosaicing/im_lrmerge.c index cc86f520..fc24191d 100644 --- a/libsrc/mosaicing/im_lrmerge.c +++ b/libsrc/mosaicing/im_lrmerge.c @@ -219,7 +219,7 @@ find_first( REGION *ir, int *pos, int x, int y, int w ) case IM_BANDFMT_DPCOMPLEX:lsearch( double ); break; default: - im_error( "im_lrmerge", _( "internal error" ) ); + im_error( "im_lrmerge", "%s", _( "internal error" ) ); return( -1 ); } @@ -268,7 +268,7 @@ find_last( REGION *ir, int *pos, int x, int y, int w ) case IM_BANDFMT_DPCOMPLEX:rsearch( double ); break; default: - im_error( "im_lrmerge", _( "internal error" ) ); + im_error( "im_lrmerge", "%s", _( "internal error" ) ); return( -1 ); } @@ -609,7 +609,7 @@ lr_blend( REGION *or, MergeInfo *inf, Overlapping *ovlap, Rect *oreg ) fblend( double, im->Bands*2, pr, ps, q ); break; default: - im_error( "im_lrmerge", _( "internal error" ) ); + im_error( "im_lrmerge", "%s", _( "internal error" ) ); return( -1 ); } } @@ -707,7 +707,8 @@ im__build_mergestate( IMAGE *ref, IMAGE *sec, IMAGE *out, if( !ovlap ) return( NULL ); if( mwidth < -1 ) { - im_error( "im_lr/tbmerge", _( "mwidth must be -1 or >= 0" ) ); + im_error( "im_lr/tbmerge", + "%s", _( "mwidth must be -1 or >= 0" ) ); return( NULL ); } @@ -736,7 +737,7 @@ im__build_mergestate( IMAGE *ref, IMAGE *sec, IMAGE *out, */ im_rect_intersectrect( &ovlap->rarea, &ovlap->sarea, &ovlap->overlap ); if( im_rect_isempty( &ovlap->overlap ) ) { - im_error( "im_lr/tbmerge", _( "no overlap" ) ); + im_error( "im_lr/tbmerge", "%s", _( "no overlap" ) ); return( NULL ); } @@ -806,7 +807,7 @@ build_lrstate( IMAGE *ref, IMAGE *sec, IMAGE *out, int dx, int dy, int mwidth ) break; default: - im_error( "im_lrmerge", _( "unknown coding type" ) ); + im_error( "im_lrmerge", "%s", _( "unknown coding type" ) ); return( NULL ); } @@ -823,7 +824,7 @@ build_lrstate( IMAGE *ref, IMAGE *sec, IMAGE *out, int dx, int dy, int mwidth ) */ if( IM_RECT_RIGHT( &ovlap->rarea ) > IM_RECT_RIGHT( &ovlap->sarea ) || ovlap->rarea.left > ovlap->sarea.left ) { - im_error( "im_lrmerge", _( "too much overlap" ) ); + im_error( "im_lrmerge", "%s", _( "too much overlap" ) ); return( NULL ); } @@ -1067,12 +1068,13 @@ im__lrmerge( IMAGE *ref, IMAGE *sec, IMAGE *out, int dx, int dy, int mwidth ) if( ref->Bands != sec->Bands || ref->Bbits != sec->Bbits || ref->BandFmt != sec->BandFmt || ref->Coding != sec->Coding ) { - im_error( "im_lrmerge", _( "input images incompatible" ) ); + im_error( "im_lrmerge", + "%s", _( "input images incompatible" ) ); return( -1 ); } if( ref->Coding != IM_CODING_NONE && ref->Coding != IM_CODING_LABQ ) { im_error( "im_lrmerge", - _( "inputs not uncoded or IM_CODING_LABQ" ) ); + "%s", _( "inputs not uncoded or IM_CODING_LABQ" ) ); return( -1 ); } if( dx > 0 || dx < 1 - ref->Xsize ) { diff --git a/libsrc/mosaicing/im_tbmerge.c b/libsrc/mosaicing/im_tbmerge.c index b9432e79..ae953023 100644 --- a/libsrc/mosaicing/im_tbmerge.c +++ b/libsrc/mosaicing/im_tbmerge.c @@ -159,7 +159,7 @@ find_top( REGION *ir, int *pos, int x, int y, int h ) case IM_BANDFMT_DPCOMPLEX:tsearch( double ); break; default: - im_error( "im_tbmerge", _( "internal error" ) ); + im_error( "im_tbmerge", "%s", _( "internal error" ) ); return( -1 ); } @@ -213,7 +213,7 @@ find_bot( REGION *ir, int *pos, int x, int y, int h ) case IM_BANDFMT_DPCOMPLEX:rsearch( double ); break; default: - im_error( "im_tbmerge", _( "internal error" ) ); + im_error( "im_tbmerge", "%s", _( "internal error" ) ); return( -1 ); } @@ -531,7 +531,7 @@ tb_blend( REGION *or, MergeInfo *inf, Overlapping *ovlap, Rect *oreg ) fblend( double, im->Bands*2, pr, ps, q ); break; default: - im_error( "im_tbmerge", _( "internal error" ) ); + im_error( "im_tbmerge", "%s", _( "internal error" ) ); return( -1 ); } } @@ -629,7 +629,7 @@ build_tbstate( IMAGE *ref, IMAGE *sec, IMAGE *out, int dx, int dy, int mwidth ) break; default: - im_error( "im_tbmerge", _( "unknown coding type" ) ); + im_error( "im_tbmerge", "%s", _( "unknown coding type" ) ); return( NULL ); } @@ -647,7 +647,7 @@ build_tbstate( IMAGE *ref, IMAGE *sec, IMAGE *out, int dx, int dy, int mwidth ) */ if( IM_RECT_BOTTOM( &ovlap->rarea ) > IM_RECT_BOTTOM( &ovlap->sarea ) || ovlap->rarea.top > ovlap->sarea.top ) { - im_error( "im_tbmerge", _( "too much overlap" ) ); + im_error( "im_tbmerge", "%s", _( "too much overlap" ) ); return( NULL ); } @@ -668,12 +668,13 @@ im__tbmerge( IMAGE *ref, IMAGE *sec, IMAGE *out, int dx, int dy, int mwidth ) if( ref->Bands != sec->Bands || ref->Bbits != sec->Bbits || ref->BandFmt != sec->BandFmt || ref->Coding != sec->Coding ) { - im_error( "im_tbmerge", _( "input images incompatible" ) ); + im_error( "im_tbmerge", + "%s", _( "input images incompatible" ) ); return( -1 ); } if( ref->Coding != IM_CODING_NONE && ref->Coding != IM_CODING_LABQ ) { im_error( "im_tbmerge", - _( "inputs not uncoded or IM_CODING_LABQ" ) ); + "%s", _( "inputs not uncoded or IM_CODING_LABQ" ) ); return( -1 ); } if( dy > 0 || dy < 1 - ref->Ysize ) { diff --git a/libsrc/mosaicing/mosaic1.c b/libsrc/mosaicing/mosaic1.c index d59f4548..680f9da8 100644 --- a/libsrc/mosaicing/mosaic1.c +++ b/libsrc/mosaicing/mosaic1.c @@ -133,7 +133,7 @@ im__lrmerge1( IMAGE *ref, IMAGE *sec, IMAGE *out, im_buf_appendf( &buf, "> <" ); im_buf_appendg( &buf, dy ); im_buf_appendf( &buf, "> <%d>", mwidth ); - if( im_histlin( out, im_buf_all( &buf ) ) ) + if( im_histlin( out, "%s", im_buf_all( &buf ) ) ) return( -1 ); return( 0 ); @@ -175,7 +175,7 @@ im__tbmerge1( IMAGE *ref, IMAGE *sec, IMAGE *out, im_buf_appendf( &buf, "> <" ); im_buf_appendg( &buf, dy ); im_buf_appendf( &buf, "> <%d>", mwidth ); - if( im_histlin( out, im_buf_all( &buf ) ) ) + if( im_histlin( out, "%s", im_buf_all( &buf ) ) ) return( -1 ); return( 0 ); diff --git a/libsrc/mosaicing/mosaicing_dispatch.c b/libsrc/mosaicing/mosaicing_dispatch.c index 251f8c9a..c925f71d 100644 --- a/libsrc/mosaicing/mosaicing_dispatch.c +++ b/libsrc/mosaicing/mosaicing_dispatch.c @@ -587,7 +587,7 @@ affinei_vec( im_object *argv ) break; default: - im_error( "affinei_vec", _( "bad interpolation" ) ); + im_error( "affinei_vec", "%s", _( "bad interpolation" ) ); return( -1 ); }