Merge remote-tracking branch 'origin/master' into gate
This commit is contained in:
commit
d49eed6d20
|
@ -1,3 +1,4 @@
|
||||||
|
scan
|
||||||
po/*.pot
|
po/*.pot
|
||||||
test-driver
|
test-driver
|
||||||
vips-*.tar.gz
|
vips-*.tar.gz
|
||||||
|
|
24
README.md
24
README.md
|
@ -50,6 +50,30 @@ Leak check:
|
||||||
--leak-check=yes \
|
--leak-check=yes \
|
||||||
vips ... > vips-vg.log 2>&1
|
vips ... > vips-vg.log 2>&1
|
||||||
|
|
||||||
|
Clang build:
|
||||||
|
|
||||||
|
$ CC=clang CXX=clang++ ./configure --prefix=/home/john/vips
|
||||||
|
|
||||||
|
Clang static analysis:
|
||||||
|
|
||||||
|
$ scan-build ./configure --disable-introspection
|
||||||
|
$ scan-build -o scan -v make
|
||||||
|
$ scan-view scan/2013-11-22-2
|
||||||
|
|
||||||
|
Clang dynamic analysis:
|
||||||
|
|
||||||
|
$ CC=clang CXX=clang++ LD=clang \
|
||||||
|
CFLAGS="-O1 -fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls" \
|
||||||
|
CXXFLAGS="-O1 -fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls" \
|
||||||
|
LDFLAGS=-fsanitize=address \
|
||||||
|
./configure --prefix=/home/john/vips --disable-introspection
|
||||||
|
|
||||||
|
$ CC=clang CXX=clang++ LD=clang \
|
||||||
|
CFLAGS="-g -O1 -fsanitize=thread -fPIC -pie -fno-omit-frame-pointer -fno-optimize-sibling-calls" \
|
||||||
|
CXXFLAGS="-g -O1 -fsanitize=thread -fPIC -pie -fno-omit-frame-pointer -fno-optimize-sibling-calls" \
|
||||||
|
LDFLAGS="-fsanitize=thread -fPIC -pie" \
|
||||||
|
./configure --prefix=/home/john/vips --disable-introspection
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
|
|
||||||
libvips has to have gettext, glib-2.x and libxml-2.0. The build system needs
|
libvips has to have gettext, glib-2.x and libxml-2.0. The build system needs
|
||||||
|
|
|
@ -62,11 +62,13 @@ G_DEFINE_TYPE( VipsLCh2Lab, vips_LCh2Lab, VIPS_TYPE_COLOUR_SPACE );
|
||||||
static void
|
static void
|
||||||
vips_LCh2Lab_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width )
|
vips_LCh2Lab_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width )
|
||||||
{
|
{
|
||||||
float *p = (float *) in[0];
|
float *p;
|
||||||
float *q = (float *) out;
|
float *q;
|
||||||
|
|
||||||
int x;
|
int x;
|
||||||
|
|
||||||
|
p = (float *) in[0];
|
||||||
|
q = (float *) out;
|
||||||
|
|
||||||
for( x = 0; x < width; x++ ) {
|
for( x = 0; x < width; x++ ) {
|
||||||
float L = p[0];
|
float L = p[0];
|
||||||
float C = p[1];
|
float C = p[1];
|
||||||
|
@ -81,6 +83,7 @@ vips_LCh2Lab_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width )
|
||||||
q[0] = L;
|
q[0] = L;
|
||||||
q[1] = a;
|
q[1] = a;
|
||||||
q[2] = b;
|
q[2] = b;
|
||||||
|
|
||||||
q += 3;
|
q += 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -103,7 +106,7 @@ vips_col_Ch2ab( float C, float h, float *a, float *b )
|
||||||
|
|
||||||
in[1] = C;
|
in[1] = C;
|
||||||
in[2] = h;
|
in[2] = h;
|
||||||
x = in;
|
x = &in[0];
|
||||||
vips_LCh2Lab_line( NULL, (VipsPel *) out, (VipsPel **) &x, 1 );
|
vips_LCh2Lab_line( NULL, (VipsPel *) out, (VipsPel **) &x, 1 );
|
||||||
*a = out[1];
|
*a = out[1];
|
||||||
*b = out[2];
|
*b = out[2];
|
||||||
|
|
|
@ -98,11 +98,13 @@ vips_col_ab2Ch( float a, float b, float *C, float *h )
|
||||||
static void
|
static void
|
||||||
vips_Lab2LCh_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width )
|
vips_Lab2LCh_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width )
|
||||||
{
|
{
|
||||||
float *p = (float *) in[0];
|
float *p;
|
||||||
float *q = (float *) out;
|
float *q;
|
||||||
|
|
||||||
int x;
|
int x;
|
||||||
|
|
||||||
|
p = (float *) in[0];
|
||||||
|
q = (float *) out;
|
||||||
|
|
||||||
for( x = 0; x < width; x++ ) {
|
for( x = 0; x < width; x++ ) {
|
||||||
float L = p[0];
|
float L = p[0];
|
||||||
float a = p[1];
|
float a = p[1];
|
||||||
|
|
|
@ -635,7 +635,7 @@ vips_icc_export_build( VipsObject *object )
|
||||||
if( !vips_object_argument_isset( object, "pcs" ) &&
|
if( !vips_object_argument_isset( object, "pcs" ) &&
|
||||||
code->in &&
|
code->in &&
|
||||||
code->in->Type == VIPS_INTERPRETATION_XYZ )
|
code->in->Type == VIPS_INTERPRETATION_XYZ )
|
||||||
icc->pcs = VIPS_INTERPRETATION_XYZ;
|
icc->pcs = VIPS_PCS_XYZ;
|
||||||
|
|
||||||
if( icc->pcs == VIPS_PCS_LAB ) {
|
if( icc->pcs == VIPS_PCS_LAB ) {
|
||||||
#ifdef HAVE_LCMS2
|
#ifdef HAVE_LCMS2
|
||||||
|
|
|
@ -172,7 +172,7 @@ vips_cast_start( VipsImage *out, void *a, void *b )
|
||||||
seq->underflow = 0;
|
seq->underflow = 0;
|
||||||
|
|
||||||
if( !seq->ir ) {
|
if( !seq->ir ) {
|
||||||
vips_cast_stop( seq, NULL, NULL );
|
vips_cast_stop( seq, a, b );
|
||||||
return( NULL );
|
return( NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -236,7 +236,6 @@ vips_rot45_build( VipsObject *object )
|
||||||
|
|
||||||
case VIPS_ANGLE45_45:
|
case VIPS_ANGLE45_45:
|
||||||
vips_rot45_rot45( t[0], from );
|
vips_rot45_rot45( t[0], from );
|
||||||
from = t[0];
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -104,6 +104,7 @@ vips_convolution_class_init( VipsConvolutionClass *class )
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class = G_OBJECT_CLASS( class );
|
GObjectClass *gobject_class = G_OBJECT_CLASS( class );
|
||||||
VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class );
|
VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class );
|
||||||
|
VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class );
|
||||||
|
|
||||||
gobject_class->set_property = vips_object_set_property;
|
gobject_class->set_property = vips_object_set_property;
|
||||||
gobject_class->get_property = vips_object_get_property;
|
gobject_class->get_property = vips_object_get_property;
|
||||||
|
@ -112,6 +113,8 @@ vips_convolution_class_init( VipsConvolutionClass *class )
|
||||||
vobject_class->description = _( "convolution operations" );
|
vobject_class->description = _( "convolution operations" );
|
||||||
vobject_class->build = vips_convolution_build;
|
vobject_class->build = vips_convolution_build;
|
||||||
|
|
||||||
|
operation_class->flags = VIPS_OPERATION_SEQUENTIAL;
|
||||||
|
|
||||||
/* Inputs set by subclassess.
|
/* Inputs set by subclassess.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -131,6 +131,7 @@ vips_correlation_class_init( VipsCorrelationClass *class )
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class = G_OBJECT_CLASS( class );
|
GObjectClass *gobject_class = G_OBJECT_CLASS( class );
|
||||||
VipsObjectClass *object_class = (VipsObjectClass *) class;
|
VipsObjectClass *object_class = (VipsObjectClass *) class;
|
||||||
|
VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class );
|
||||||
|
|
||||||
gobject_class->set_property = vips_object_set_property;
|
gobject_class->set_property = vips_object_set_property;
|
||||||
gobject_class->get_property = vips_object_get_property;
|
gobject_class->get_property = vips_object_get_property;
|
||||||
|
@ -139,6 +140,8 @@ vips_correlation_class_init( VipsCorrelationClass *class )
|
||||||
object_class->description = _( "correlation operation" );
|
object_class->description = _( "correlation operation" );
|
||||||
object_class->build = vips_correlation_build;
|
object_class->build = vips_correlation_build;
|
||||||
|
|
||||||
|
operation_class->flags = VIPS_OPERATION_SEQUENTIAL;
|
||||||
|
|
||||||
VIPS_ARG_IMAGE( class, "in", 0,
|
VIPS_ARG_IMAGE( class, "in", 0,
|
||||||
_( "Input" ),
|
_( "Input" ),
|
||||||
_( "Input image argument" ),
|
_( "Input image argument" ),
|
||||||
|
|
|
@ -102,6 +102,7 @@ vips_gaussblur_class_init( VipsGaussblurClass *class )
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class = G_OBJECT_CLASS( class );
|
GObjectClass *gobject_class = G_OBJECT_CLASS( class );
|
||||||
VipsObjectClass *object_class = (VipsObjectClass *) class;
|
VipsObjectClass *object_class = (VipsObjectClass *) class;
|
||||||
|
VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class );
|
||||||
|
|
||||||
gobject_class->set_property = vips_object_set_property;
|
gobject_class->set_property = vips_object_set_property;
|
||||||
gobject_class->get_property = vips_object_get_property;
|
gobject_class->get_property = vips_object_get_property;
|
||||||
|
@ -110,6 +111,8 @@ vips_gaussblur_class_init( VipsGaussblurClass *class )
|
||||||
object_class->description = _( "Unsharp masking for print" );
|
object_class->description = _( "Unsharp masking for print" );
|
||||||
object_class->build = vips_gaussblur_build;
|
object_class->build = vips_gaussblur_build;
|
||||||
|
|
||||||
|
operation_class->flags = VIPS_OPERATION_SEQUENTIAL;
|
||||||
|
|
||||||
VIPS_ARG_IMAGE( class, "in", 1,
|
VIPS_ARG_IMAGE( class, "in", 1,
|
||||||
_( "Input" ),
|
_( "Input" ),
|
||||||
_( "Input image" ),
|
_( "Input image" ),
|
||||||
|
|
|
@ -295,6 +295,7 @@ vips_sharpen_class_init( VipsSharpenClass *class )
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class = G_OBJECT_CLASS( class );
|
GObjectClass *gobject_class = G_OBJECT_CLASS( class );
|
||||||
VipsObjectClass *object_class = (VipsObjectClass *) class;
|
VipsObjectClass *object_class = (VipsObjectClass *) class;
|
||||||
|
VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class );
|
||||||
|
|
||||||
gobject_class->set_property = vips_object_set_property;
|
gobject_class->set_property = vips_object_set_property;
|
||||||
gobject_class->get_property = vips_object_get_property;
|
gobject_class->get_property = vips_object_get_property;
|
||||||
|
@ -303,6 +304,8 @@ vips_sharpen_class_init( VipsSharpenClass *class )
|
||||||
object_class->description = _( "Unsharp masking for print" );
|
object_class->description = _( "Unsharp masking for print" );
|
||||||
object_class->build = vips_sharpen_build;
|
object_class->build = vips_sharpen_build;
|
||||||
|
|
||||||
|
operation_class->flags = VIPS_OPERATION_SEQUENTIAL;
|
||||||
|
|
||||||
VIPS_ARG_IMAGE( class, "in", 1,
|
VIPS_ARG_IMAGE( class, "in", 1,
|
||||||
_( "Input" ),
|
_( "Input" ),
|
||||||
_( "Input image" ),
|
_( "Input image" ),
|
||||||
|
|
|
@ -48,7 +48,8 @@
|
||||||
static VipsFormatFlags
|
static VipsFormatFlags
|
||||||
analyze_flags( const char *filename )
|
analyze_flags( const char *filename )
|
||||||
{
|
{
|
||||||
return( vips_foreign_flags( "analyzeload", filename ) );
|
return( (VipsFormatFlags)
|
||||||
|
vips_foreign_flags( "analyzeload", filename ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
|
@ -74,7 +74,8 @@ exr_flags( const char *name )
|
||||||
|
|
||||||
im_filename_split( name, filename, mode );
|
im_filename_split( name, filename, mode );
|
||||||
|
|
||||||
return( vips_foreign_flags( "openexrload", filename ) );
|
return( (VipsFormatFlags)
|
||||||
|
vips_foreign_flags( "openexrload", filename ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
|
@ -110,7 +110,8 @@ openslide_flags( const char *name )
|
||||||
|
|
||||||
im_filename_split( name, filename, mode );
|
im_filename_split( name, filename, mode );
|
||||||
|
|
||||||
return( vips_foreign_flags( "openslideload", filename ) );
|
return( (VipsFormatFlags)
|
||||||
|
vips_foreign_flags( "openslideload", filename ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
|
@ -63,7 +63,8 @@ isppm( const char *filename )
|
||||||
static VipsFormatFlags
|
static VipsFormatFlags
|
||||||
ppm_flags( const char *filename )
|
ppm_flags( const char *filename )
|
||||||
{
|
{
|
||||||
return( vips_foreign_flags( "ppmload", filename ) );
|
return( (VipsFormatFlags)
|
||||||
|
vips_foreign_flags( "ppmload", filename ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *ppm_suffs[] = { ".ppm", ".pgm", ".pbm", ".pfm", NULL };
|
static const char *ppm_suffs[] = { ".ppm", ".pgm", ".pbm", ".pfm", NULL };
|
||||||
|
|
|
@ -132,7 +132,8 @@ tiff_flags( const char *name )
|
||||||
|
|
||||||
im_filename_split( name, filename, mode );
|
im_filename_split( name, filename, mode );
|
||||||
|
|
||||||
return( vips_foreign_flags( "tiffload", filename ) );
|
return( (VipsFormatFlags)
|
||||||
|
vips_foreign_flags( "tiffload", filename ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
|
@ -183,7 +183,7 @@ read_double( FILE *fp, const char whitemap[256], const char sepmap[256],
|
||||||
if( ch == '"' ) {
|
if( ch == '"' ) {
|
||||||
(void) fgetc( fp );
|
(void) fgetc( fp );
|
||||||
(void) skip_to_quote( fp );
|
(void) skip_to_quote( fp );
|
||||||
ch = fgetc( fp );
|
(void) fgetc( fp );
|
||||||
}
|
}
|
||||||
else if( !sepmap[ch] &&
|
else if( !sepmap[ch] &&
|
||||||
fscanf( fp, "%lf", out ) != 1 ) {
|
fscanf( fp, "%lf", out ) != 1 ) {
|
||||||
|
@ -196,7 +196,7 @@ read_double( FILE *fp, const char whitemap[256], const char sepmap[256],
|
||||||
|
|
||||||
/* Step over the bad data to the next separator.
|
/* Step over the bad data to the next separator.
|
||||||
*/
|
*/
|
||||||
ch = skip_to_sep( fp, sepmap );
|
(void) skip_to_sep( fp, sepmap );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Don't need to check result, we have read a field successfully.
|
/* Don't need to check result, we have read a field successfully.
|
||||||
|
|
|
@ -225,7 +225,6 @@ vips_fits_get_header( VipsFits *fits, VipsImage *out )
|
||||||
VIPS_DEBUG_MSG( "%d) %lld\n", i, fits->naxes[i] );
|
VIPS_DEBUG_MSG( "%d) %lld\n", i, fits->naxes[i] );
|
||||||
#endif /*VIPS_DEBUG*/
|
#endif /*VIPS_DEBUG*/
|
||||||
|
|
||||||
width = 1;
|
|
||||||
height = 1;
|
height = 1;
|
||||||
bands = 1;
|
bands = 1;
|
||||||
switch( fits->naxis ) {
|
switch( fits->naxis ) {
|
||||||
|
|
|
@ -157,7 +157,6 @@ mat2vips_get_header( matvar_t *var, VipsImage *im )
|
||||||
VipsInterpretation interpretation;
|
VipsInterpretation interpretation;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
width = 1;
|
|
||||||
height = 1;
|
height = 1;
|
||||||
bands = 1;
|
bands = 1;
|
||||||
switch( var->rank ) {
|
switch( var->rank ) {
|
||||||
|
|
|
@ -67,7 +67,7 @@ G_DEFINE_TYPE( VipsForeignLoadPpm, vips_foreign_load_ppm,
|
||||||
static VipsForeignFlags
|
static VipsForeignFlags
|
||||||
vips_foreign_load_ppm_get_flags_filename( const char *filename )
|
vips_foreign_load_ppm_get_flags_filename( const char *filename )
|
||||||
{
|
{
|
||||||
return( vips__ppm_flags( filename ) );
|
return( (VipsForeignFlags) vips__ppm_flags( filename ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
static VipsForeignFlags
|
static VipsForeignFlags
|
||||||
|
|
|
@ -1424,8 +1424,11 @@ read_stripwise( ReadTiff *rtiff, VipsImage *out )
|
||||||
|
|
||||||
/* rows_per_strip can be 2 ** 32 - 1, meaning the whole image. Clip
|
/* rows_per_strip can be 2 ** 32 - 1, meaning the whole image. Clip
|
||||||
* this down to ysize to avoid confusing vips.
|
* this down to ysize to avoid confusing vips.
|
||||||
|
*
|
||||||
|
* And it musn't be zero.
|
||||||
*/
|
*/
|
||||||
rtiff->rows_per_strip = VIPS_MIN( rtiff->rows_per_strip, t[0]->Ysize );
|
rtiff->rows_per_strip =
|
||||||
|
VIPS_CLIP( 1, rtiff->rows_per_strip, t[0]->Ysize );
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf( "read_stripwise: rows_per_strip = %u\n",
|
printf( "read_stripwise: rows_per_strip = %u\n",
|
||||||
|
|
|
@ -1190,7 +1190,7 @@ write_tif_stripwise( TiffWrite *tw )
|
||||||
static void
|
static void
|
||||||
delete_files( TiffWrite *tw )
|
delete_files( TiffWrite *tw )
|
||||||
{
|
{
|
||||||
PyramidLayer *layer = tw->layer;
|
PyramidLayer *layer;
|
||||||
|
|
||||||
if( tw->bname ) {
|
if( tw->bname ) {
|
||||||
#ifndef DEBUG
|
#ifndef DEBUG
|
||||||
|
|
|
@ -186,7 +186,7 @@ read_image( Read *read, VipsImage *out )
|
||||||
{
|
{
|
||||||
VipsImage **t = (VipsImage **)
|
VipsImage **t = (VipsImage **)
|
||||||
vips_object_local_array( VIPS_OBJECT( out ), 3 );
|
vips_object_local_array( VIPS_OBJECT( out ), 3 );
|
||||||
guint64 length;
|
gint64 length;
|
||||||
void *data;
|
void *data;
|
||||||
int fd;
|
int fd;
|
||||||
webp_decoder decoder;
|
webp_decoder decoder;
|
||||||
|
|
|
@ -93,7 +93,8 @@ vips_hist_local_stop( void *vseq, void *a, void *b )
|
||||||
VipsImage *in = (VipsImage *) a;
|
VipsImage *in = (VipsImage *) a;
|
||||||
|
|
||||||
VIPS_UNREF( seq->ir );
|
VIPS_UNREF( seq->ir );
|
||||||
if( seq->hist ) {
|
if( seq->hist &&
|
||||||
|
in ) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for( i = 0; i < in->Bands; i++ )
|
for( i = 0; i < in->Bands; i++ )
|
||||||
|
|
|
@ -86,12 +86,15 @@ void *vips_foreign_map( const char *base,
|
||||||
VipsSListMap2Fn fn, void *a, void *b );
|
VipsSListMap2Fn fn, void *a, void *b );
|
||||||
|
|
||||||
/* Image file load properties.
|
/* Image file load properties.
|
||||||
|
*
|
||||||
|
* Keep in sync with the deprecated VipsFormatFlags, we need to be able to
|
||||||
|
* cast between them.
|
||||||
*/
|
*/
|
||||||
typedef enum /*< flags >*/ {
|
typedef enum /*< flags >*/ {
|
||||||
VIPS_FOREIGN_NONE = 0, /* No flags set */
|
VIPS_FOREIGN_NONE = 0, /* No flags set */
|
||||||
VIPS_FOREIGN_PARTIAL = 1, /* Lazy read OK (eg. tiled tiff) */
|
VIPS_FOREIGN_PARTIAL = 1, /* Lazy read OK (eg. tiled tiff) */
|
||||||
VIPS_FOREIGN_SEQUENTIAL = 2, /* Top-to-bottom lazy read OK */
|
VIPS_FOREIGN_BIGENDIAN = 2, /* Most-significant byte first */
|
||||||
VIPS_FOREIGN_BIGENDIAN = 4, /* Most-significant byte first */
|
VIPS_FOREIGN_SEQUENTIAL = 4, /* Top-to-bottom lazy read OK */
|
||||||
VIPS_FOREIGN_ALL = 7 /* All flags set */
|
VIPS_FOREIGN_ALL = 7 /* All flags set */
|
||||||
} VipsForeignFlags;
|
} VipsForeignFlags;
|
||||||
|
|
||||||
|
|
|
@ -235,7 +235,7 @@ typedef struct _VipsImage {
|
||||||
* file start. Usually VIPS_SIZEOF_HEADER, but can be something else
|
* file start. Usually VIPS_SIZEOF_HEADER, but can be something else
|
||||||
* for binary file read.
|
* for binary file read.
|
||||||
*
|
*
|
||||||
* gint64 so that we can guarantee to work even on systems with
|
* guint64 so that we can guarantee to work even on systems with
|
||||||
* strange ideas about large files.
|
* strange ideas about large files.
|
||||||
*/
|
*/
|
||||||
guint64 sizeof_header;
|
guint64 sizeof_header;
|
||||||
|
|
|
@ -127,10 +127,9 @@ typedef struct {
|
||||||
static Buffer *
|
static Buffer *
|
||||||
buffer_build( void )
|
buffer_build( void )
|
||||||
{
|
{
|
||||||
Buffer *buf = IM_NEW( NULL, Buffer );
|
Buffer *buf;
|
||||||
|
|
||||||
if( !buf )
|
buf = g_new( Buffer, 1 );
|
||||||
return( NULL );
|
|
||||||
buf->next = NULL;
|
buf->next = NULL;
|
||||||
buf->n = 0;
|
buf->n = 0;
|
||||||
|
|
||||||
|
@ -146,7 +145,7 @@ buffer_free( Buffer *buf )
|
||||||
Buffer *p;
|
Buffer *p;
|
||||||
|
|
||||||
p = buf->next;
|
p = buf->next;
|
||||||
im_free( buf );
|
g_free( buf );
|
||||||
buf = p;
|
buf = p;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -175,8 +174,7 @@ buffer_add( Buffer *buf, Flood *flood, int x1, int x2, int y, int dir )
|
||||||
if( buf->n == PBUFSIZE ) {
|
if( buf->n == PBUFSIZE ) {
|
||||||
Buffer *new;
|
Buffer *new;
|
||||||
|
|
||||||
if( !(new = buffer_build()) )
|
new = buffer_build();
|
||||||
return( NULL );
|
|
||||||
new->next = buf;
|
new->next = buf;
|
||||||
buf = new;
|
buf = new;
|
||||||
}
|
}
|
||||||
|
@ -382,13 +380,10 @@ flood_new( IMAGE *image, IMAGE *test, int x, int y, VipsPel *ink, Rect *dout )
|
||||||
flood->top = y;
|
flood->top = y;
|
||||||
flood->right = x;
|
flood->right = x;
|
||||||
flood->bottom = y;
|
flood->bottom = y;
|
||||||
|
flood->in = buffer_build();
|
||||||
|
flood->out = buffer_build();
|
||||||
|
|
||||||
flood->in = NULL;
|
if( !(flood->edge = (VipsPel *) im_malloc( NULL, flood->tsize )) ) {
|
||||||
flood->out = NULL;
|
|
||||||
|
|
||||||
if( !(flood->edge = (VipsPel *) im_malloc( NULL, flood->tsize )) ||
|
|
||||||
!(flood->in = buffer_build()) ||
|
|
||||||
!(flood->out = buffer_build()) ) {
|
|
||||||
flood_free( flood );
|
flood_free( flood );
|
||||||
return( NULL );
|
return( NULL );
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,8 +14,8 @@ vips_foreign_flags_get_type( void )
|
||||||
static const GFlagsValue values[] = {
|
static const GFlagsValue values[] = {
|
||||||
{VIPS_FOREIGN_NONE, "VIPS_FOREIGN_NONE", "none"},
|
{VIPS_FOREIGN_NONE, "VIPS_FOREIGN_NONE", "none"},
|
||||||
{VIPS_FOREIGN_PARTIAL, "VIPS_FOREIGN_PARTIAL", "partial"},
|
{VIPS_FOREIGN_PARTIAL, "VIPS_FOREIGN_PARTIAL", "partial"},
|
||||||
{VIPS_FOREIGN_SEQUENTIAL, "VIPS_FOREIGN_SEQUENTIAL", "sequential"},
|
|
||||||
{VIPS_FOREIGN_BIGENDIAN, "VIPS_FOREIGN_BIGENDIAN", "bigendian"},
|
{VIPS_FOREIGN_BIGENDIAN, "VIPS_FOREIGN_BIGENDIAN", "bigendian"},
|
||||||
|
{VIPS_FOREIGN_SEQUENTIAL, "VIPS_FOREIGN_SEQUENTIAL", "sequential"},
|
||||||
{VIPS_FOREIGN_ALL, "VIPS_FOREIGN_ALL", "all"},
|
{VIPS_FOREIGN_ALL, "VIPS_FOREIGN_ALL", "all"},
|
||||||
{0, NULL, NULL}
|
{0, NULL, NULL}
|
||||||
};
|
};
|
||||||
|
|
|
@ -879,9 +879,9 @@ vips_image_build( VipsObject *object )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'a':
|
case 'a':
|
||||||
/* Check parameters.
|
/* Ban crazy numbers.
|
||||||
*/
|
*/
|
||||||
if( image->sizeof_header < 0 ) {
|
if( image->sizeof_header > 1000000 ) {
|
||||||
vips_error( "VipsImage", "%s", _( "bad parameters" ) );
|
vips_error( "VipsImage", "%s", _( "bad parameters" ) );
|
||||||
return( -1 );
|
return( -1 );
|
||||||
}
|
}
|
||||||
|
|
|
@ -564,6 +564,9 @@ vips_call_required_optional( VipsOperation **operation,
|
||||||
va_end( a );
|
va_end( a );
|
||||||
va_end( b );
|
va_end( b );
|
||||||
|
|
||||||
|
if( result )
|
||||||
|
return( -1 );
|
||||||
|
|
||||||
/* Build from cache.
|
/* Build from cache.
|
||||||
*/
|
*/
|
||||||
if( vips_cache_operation_buildp( operation ) )
|
if( vips_cache_operation_buildp( operation ) )
|
||||||
|
|
|
@ -132,11 +132,13 @@ char *name;
|
||||||
/* Find the x position of a file name (extract n from <root>.nxm.v).
|
/* Find the x position of a file name (extract n from <root>.nxm.v).
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
find_x( name )
|
find_x( char *name )
|
||||||
char *name;
|
{
|
||||||
{ int n;
|
int n;
|
||||||
char *p;
|
char *p;
|
||||||
char *out = strdup( name );
|
char *out;
|
||||||
|
|
||||||
|
out = strdup( name );
|
||||||
|
|
||||||
/* Chop off '.v'.
|
/* Chop off '.v'.
|
||||||
*/
|
*/
|
||||||
|
@ -166,17 +168,21 @@ char *name;
|
||||||
return( -1 );
|
return( -1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free( out );
|
||||||
|
|
||||||
return( n );
|
return( n );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Find the y position of a file name (extract m from <root>.nxm.v).
|
/* Find the y position of a file name (extract m from <root>.nxm.v).
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
find_y( name )
|
find_y( char *name )
|
||||||
char *name;
|
{
|
||||||
{ int m;
|
int m;
|
||||||
char *p;
|
char *p;
|
||||||
char *out = strdup( name );
|
char *out;
|
||||||
|
|
||||||
|
out = strdup( name );
|
||||||
|
|
||||||
/* Chop off '.v'.
|
/* Chop off '.v'.
|
||||||
*/
|
*/
|
||||||
|
@ -207,12 +213,10 @@ char *name;
|
||||||
}
|
}
|
||||||
|
|
||||||
free( out );
|
free( out );
|
||||||
|
|
||||||
return( m );
|
return( m );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
mosaic_analysis(int width, int height,IMAGE **inp, IMAGE *out,
|
mosaic_analysis(int width, int height,IMAGE **inp, IMAGE *out,
|
||||||
int xoff, int yoff, int *vxdisp, int *vydisp,int *hxdisp, int *hydisp) {
|
int xoff, int yoff, int *vxdisp, int *vydisp,int *hxdisp, int *hydisp) {
|
||||||
|
@ -260,7 +264,7 @@ double scale1, angle1, dx1, dy1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ( inp[curr_im]->Xsize < xoff ) || ( inp[curr_im+1]->Xsize < xoff ) ||
|
if( ( inp[curr_im]->Xsize < xoff ) || ( inp[curr_im+1]->Xsize < xoff ) ||
|
||||||
( inp[curr_im]->Ysize < yoff ) || ( inp[curr_im]->Ysize < yoff) ){
|
( inp[curr_im]->Ysize < yoff ) || ( inp[curr_im+1]->Ysize < yoff) ){
|
||||||
++curr_disp_x;
|
++curr_disp_x;
|
||||||
hxdisp[curr_disp_x] = 0;
|
hxdisp[curr_disp_x] = 0;
|
||||||
hydisp[curr_disp_x] = 0;
|
hydisp[curr_disp_x] = 0;
|
||||||
|
|
|
@ -258,11 +258,13 @@ char *name;
|
||||||
/* Find the x position of a file name (extract n from <root>.nxm.v).
|
/* Find the x position of a file name (extract n from <root>.nxm.v).
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
find_x( name )
|
find_x( char *name )
|
||||||
char *name;
|
{
|
||||||
{ int n;
|
int n;
|
||||||
char *p;
|
char *p;
|
||||||
char *out = strdup( name );
|
char *out;
|
||||||
|
|
||||||
|
out = strdup( name );
|
||||||
|
|
||||||
/* Chop off '.v'.
|
/* Chop off '.v'.
|
||||||
*/
|
*/
|
||||||
|
@ -292,17 +294,21 @@ char *name;
|
||||||
return( -1 );
|
return( -1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free( out );
|
||||||
|
|
||||||
return( n );
|
return( n );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Find the y position of a file name (extract m from <root>.nxm.v).
|
/* Find the y position of a file name (extract m from <root>.nxm.v).
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
find_y( name )
|
find_y( char *name )
|
||||||
char *name;
|
{
|
||||||
{ int m;
|
int m;
|
||||||
char *p;
|
char *p;
|
||||||
char *out = strdup( name );
|
char *out;
|
||||||
|
|
||||||
|
out = strdup( name );
|
||||||
|
|
||||||
/* Chop off '.v'.
|
/* Chop off '.v'.
|
||||||
*/
|
*/
|
||||||
|
@ -333,14 +339,10 @@ char *name;
|
||||||
}
|
}
|
||||||
|
|
||||||
free( out );
|
free( out );
|
||||||
|
|
||||||
return( m );
|
return( m );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Join two frames left-right. Have to open them and find their sizes.
|
/* Join two frames left-right. Have to open them and find their sizes.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
|
|
Loading…
Reference in New Issue