clean out debugging code
This commit is contained in:
parent
8e0de67f65
commit
4901c9f6a5
31
TODO
31
TODO
@ -4,37 +4,6 @@
|
||||
|
||||
trim this down!
|
||||
|
||||
- seq is disabled in colour.c
|
||||
|
||||
|
||||
|
||||
- try:
|
||||
|
||||
$ valgrind --db-attach=yes vips sRGB2XYZ kylie110.jpg x2.v --vips-cache-trace --vips-concurrency=1 --vips-progress
|
||||
|
||||
get:
|
||||
|
||||
==22629== Thread 4:
|
||||
==22629== Conditional jump or move depends on uninitialised value(s)
|
||||
==22629== at 0x4EDA287: vips_col_sRGB2XYZ (LabQ2sRGB.c:259)
|
||||
==22629== by 0x4EDB1DC: vips_sRGB2XYZ_line (sRGB2XYZ.c:78)
|
||||
|
||||
|
||||
the .jpg is read to a mem buffer, we then process from that
|
||||
|
||||
the mem buffer is created OK and we don't get unint errors if we read from
|
||||
there during create
|
||||
|
||||
the vips_sRGB2XYZ_line() is called with p pointing to the start of the mem
|
||||
buffer and triggers the uninit
|
||||
|
||||
therefore something during the rewind must be causing uninit to be set
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
- add mono as a colourspace? also rad?
|
||||
|
||||
|
@ -69,20 +69,6 @@ vips_colour_gen( VipsRegion *or,
|
||||
if( vips_region_prepare( ir[i], r ) )
|
||||
return( -1 );
|
||||
|
||||
int x;
|
||||
int sum;
|
||||
|
||||
printf( "vips_colour_gen: testing mem buffer #5 %p for uninit\n",
|
||||
VIPS_REGION_ADDR( ir[0], r->left, r->top ) );
|
||||
sum = 0;
|
||||
for( y = 0; y < r->height; y++ )
|
||||
for( x = 0; x < r->width; x++ )
|
||||
sum +=
|
||||
VIPS_REGION_ADDR( ir[0], x + r->left, y + r->top )[0] +
|
||||
VIPS_REGION_ADDR( ir[0], x + r->left, y + r->top )[1] +
|
||||
VIPS_REGION_ADDR( ir[0], x + r->left, y + r->top )[2];
|
||||
printf( "sum = %d\n", sum );
|
||||
|
||||
for( y = 0; y < r->height; y++ ) {
|
||||
for( i = 0; ir[i]; i++ )
|
||||
p[i] = VIPS_REGION_ADDR( ir[i], r->left, r->top + y );
|
||||
@ -180,7 +166,7 @@ vips_colour_class_init( VipsColourClass *class )
|
||||
vobject_class->description = _( "colour operations" );
|
||||
vobject_class->build = vips_colour_build;
|
||||
|
||||
//operation_class->flags = VIPS_OPERATION_SEQUENTIAL;
|
||||
operation_class->flags = VIPS_OPERATION_SEQUENTIAL;
|
||||
|
||||
VIPS_ARG_IMAGE( class, "out", 100,
|
||||
_( "Output" ),
|
||||
|
@ -64,18 +64,6 @@ vips_sRGB2XYZ_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width )
|
||||
|
||||
int i;
|
||||
|
||||
printf( "vips_sRGB2XYZ_line: out = %p, in = %p\n",
|
||||
out, p );
|
||||
|
||||
int sum;
|
||||
|
||||
printf( "vips_sRGB2XYZ_line: testing mem buffer #6 %p for uninit\n",
|
||||
p );
|
||||
sum = 0;
|
||||
for( i = 0; i < width; i++ )
|
||||
sum += p[0] + p[1] + p[2];
|
||||
printf( "sum = %d\n", sum );
|
||||
|
||||
for( i = 0; i < width; i++ ) {
|
||||
int r = p[0];
|
||||
int g = p[1];
|
||||
|
@ -33,8 +33,8 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
*/
|
||||
#define DEBUG
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
@ -791,19 +791,6 @@ vips_foreign_load_start( VipsImage *out, void *a, void *b )
|
||||
load->real, NULL );
|
||||
}
|
||||
|
||||
if( load->real->dtype == VIPS_IMAGE_SETBUF ) {
|
||||
int x, y;
|
||||
int sum;
|
||||
|
||||
printf( "testing mem buffer #3 %p for uninit\n",
|
||||
VIPS_IMAGE_ADDR( load->real, 0, 0 ) );
|
||||
sum = 0;
|
||||
for( y = 0; y < load->real->Ysize; y++ )
|
||||
for( x = 0; x < load->real->Xsize; x++ )
|
||||
sum += *VIPS_IMAGE_ADDR( load->real, x, y );
|
||||
printf( "sum = %d\n", sum );
|
||||
}
|
||||
|
||||
return( vips_region_new( load->real ) );
|
||||
}
|
||||
|
||||
@ -827,22 +814,6 @@ vips_foreign_load_generate( VipsRegion *or,
|
||||
if( vips_region_region( or, ir, r, r->left, r->top ) )
|
||||
return( -1 );
|
||||
|
||||
{
|
||||
int x, y;
|
||||
int sum;
|
||||
|
||||
printf( "vips_foreign_load_generate: testing mem buffer #4 %p for uninit\n",
|
||||
VIPS_REGION_ADDR( or, r->left, r->top ) );
|
||||
sum = 0;
|
||||
for( y = 0; y < r->height; y++ )
|
||||
for( x = 0; x < r->width; x++ )
|
||||
sum +=
|
||||
VIPS_REGION_ADDR( or, x + r->left, y + r->top )[0] +
|
||||
VIPS_REGION_ADDR( or, x + r->left, y + r->top )[1] +
|
||||
VIPS_REGION_ADDR( or, x + r->left, y + r->top )[2];
|
||||
printf( "sum = %d\n", sum );
|
||||
}
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
|
@ -700,24 +700,9 @@ vips_image_generate( VipsImage *image,
|
||||
if( image->dtype == VIPS_IMAGE_OPENOUT )
|
||||
res = vips_sink_disc( image,
|
||||
(VipsRegionWrite) write_vips, NULL );
|
||||
else {
|
||||
int x, y;
|
||||
int sum;
|
||||
|
||||
else
|
||||
res = vips_sink_memory( image );
|
||||
|
||||
printf( "testing mem buffer %p for uninit\n",
|
||||
VIPS_IMAGE_ADDR( image, 0, 0 ) );
|
||||
sum = 0;
|
||||
for( y = 1; y < image->Ysize; y++ )
|
||||
for( x = 0; x < image->Xsize; x++ ) {
|
||||
printf( "x = %d\n",
|
||||
*VIPS_IMAGE_ADDR( image, x, y ) );
|
||||
sum += *VIPS_IMAGE_ADDR( image, x, y );
|
||||
}
|
||||
printf( "sum = %d\n", sum );
|
||||
}
|
||||
|
||||
/* Error?
|
||||
*/
|
||||
if( res )
|
||||
@ -738,18 +723,5 @@ vips_image_generate( VipsImage *image,
|
||||
if( vips_image_written( image ) )
|
||||
return( -1 );
|
||||
|
||||
if( image->dtype == VIPS_IMAGE_SETBUF ) {
|
||||
int x, y;
|
||||
int sum;
|
||||
|
||||
printf( "testing mem buffer #2 %p for uninit\n",
|
||||
VIPS_IMAGE_ADDR( image, 0, 0 ) );
|
||||
sum = 0;
|
||||
for( y = 0; y < image->Ysize; y++ )
|
||||
for( x = 0; x < image->Xsize; x++ )
|
||||
sum += *VIPS_IMAGE_ADDR( image, x, y );
|
||||
printf( "sum = %d\n", sum );
|
||||
}
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
@ -31,8 +31,8 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
*/
|
||||
#define VIPS_DEBUG
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
@ -1896,9 +1896,6 @@ vips_image_write_prepare( VipsImage *image )
|
||||
VIPS_IMAGE_SIZEOF_IMAGE( image ))) )
|
||||
return( -1 );
|
||||
|
||||
printf( "vips_image_write_prepare: memory image at %p\n",
|
||||
image->data );
|
||||
|
||||
break;
|
||||
|
||||
case VIPS_IMAGE_OPENOUT:
|
||||
|
@ -324,8 +324,6 @@ vips_sink_memory( VipsImage *image )
|
||||
SinkMemory memory;
|
||||
int result;
|
||||
|
||||
printf( "vips_sink_memory: writing to %p\n", image->data );
|
||||
|
||||
if( sink_memory_init( &memory, image ) )
|
||||
return( -1 );
|
||||
|
||||
@ -345,7 +343,6 @@ vips_sink_memory( VipsImage *image )
|
||||
|
||||
sink_memory_free( &memory );
|
||||
|
||||
printf( "vips_sink_memory: done\n" );
|
||||
VIPS_DEBUG_MSG( "vips_sink_memory: done\n" );
|
||||
|
||||
return( result );
|
||||
|
Loading…
x
Reference in New Issue
Block a user