termdesc: disable sixel with fewer than 64 color registers up front #1716

pull/1748/head
nick black 3 years ago
parent 8d902f5c2b
commit 866e1d04d5
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -743,16 +743,10 @@ sixel_blit_inner(int leny, int lenx, sixeltable* stab,
int sixel_blit(ncplane* n, int linesize, const void* data, int leny, int lenx,
const blitterargs* bargs, int bpp __attribute__ ((unused))){
int colorregs = bargs->u.pixel.colorregs;
if(colorregs <= 0){
return -1;
}
if(colorregs > 256){
colorregs = 256;
}
// FIXME enforce this in discovery, possibly raising the value
if(colorregs < 64){
return -1;
}
assert(colorregs >= 64);
sixeltable stable = {
.map = sixelmap_create(colorregs, leny - bargs->begy, lenx - bargs->begx),
.deets = malloc(colorregs * sizeof(cdetails)),

@ -493,6 +493,9 @@ query_sixel_details(tinfo* ti, int fd){
return -1;
}
//fprintf(stderr, "Sixel ColorRegs: %d Max_x: %d Max_y: %d\n", ti->color_registers, ti->sixel_maxx, ti->sixel_maxy);
if(ti->color_registers < 64){ // FIXME try to drive it higher
return -1;
}
return 0;
}

Loading…
Cancel
Save