oiio: use seek_subimage to find EOF #549

pull/555/head
nick black 4 years ago
parent 5210e410f4
commit c136d27bd5
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -107,14 +107,14 @@ ncvisual* ncvisual_open_plane(notcurses* nc, const char* filename,
nc_err_e ncvisual_decode(ncvisual* nc){ nc_err_e ncvisual_decode(ncvisual* nc){
//fprintf(stderr, "current subimage: %d frame: %p\n", nc->image->current_subimage(), nc->frame.get()); //fprintf(stderr, "current subimage: %d frame: %p\n", nc->image->current_subimage(), nc->frame.get());
const auto &spec = nc->image->spec_dimensions(nc->framenum); const auto &spec = nc->image->spec_dimensions(nc->framenum);
/* OIIO::ImageSpec newspec;
if(nc->frame){ if(nc->frame){
fprintf(stderr, "seeking subimage: %d\n", nc->image->current_subimage() + 1); //fprintf(stderr, "seeking subimage: %d\n", nc->image->current_subimage() + 1);
OIIO::ImageSpec newspec;
if(!nc->image->seek_subimage(nc->image->current_subimage() + 1, 0, newspec)){ if(!nc->image->seek_subimage(nc->image->current_subimage() + 1, 0, newspec)){
return NCERR_EOF; return NCERR_EOF;
} }
// FIXME check newspec vis-a-vis image->spec() // FIXME check newspec vis-a-vis image->spec()?
}*/ }
//fprintf(stderr, "SUBIMAGE: %d\n", nc->image->current_subimage()); //fprintf(stderr, "SUBIMAGE: %d\n", nc->image->current_subimage());
nc->did_scaling = false; nc->did_scaling = false;
auto pixels = spec.width * spec.height;// * spec.nchannels; auto pixels = spec.width * spec.height;// * spec.nchannels;

Loading…
Cancel
Save