printf("top\n");
void autocrop( void ){	int stop=0;        uint32_t sum;	uint x,y;	uint8_t *in;	// float aR,aG,aB;	uint8_t mR,mG,mB;	memcpy(working,original,width*height*3);	mR = mG = mB = 0;	in=working;	for(y=0;y<height;y++)	for(x=0;x<width;x++)	{		if(*in<mR) *in=mR-*in; else *in=*in-mR;		in++;		if(*in<mG) *in=mG-*in; else *in=*in-mG;		in++;		if(*in<mB) *in=mB-*in; else *in=*in-mB;		in++;	}	in=working;	for(y=0;y<(height>>1) && stop==0;y++)	{		sum=blackLine(in,width);		top=y;		printf("%d : %lu / %lu\n",y,sum,width);		// if black is more than 90 % it is ok		// 90%*width< sum		if(PERCENT*width > 100*sum)		{			stop=1;		}		in+=3*width;	}	// Bottom	in=working+width*3*(height-1);	stop=0;	for(y=0;y<(height>>1) && stop==0;y++)	{		sum=blackLine(in,width);		bottom=y;		if(PERCENT*width > 100*sum)		{			stop=1;		}		in-=3*width;	}	/*	top=top & 0xfffe;	bottom=bottom & 0xfffe;	*/	upload(dialog);	update(working, width,height);	draw(dialog,width,height);}