I found why OIIO finds two channels in the file. The tga_alpha_type of the file has been set to TGA_ALPHA_UNDEFINED_RETAIN.
I do not know how TGA works, I then have a question: what is the use of such a flag ? How is it set ? Can i ignore it ? To be able to load correctly this type of file (ie discard the alpha layer), i have to parse the data buffer returned by OIIO, and it costs quite some time. I there another way to detect such an empty channel before calling "read_scanlines" which i use ? 2013/4/24 Michel Lerenard <[email protected]> > Hi, > > I've spotted a weird behavior when opening grayscale files, i'm wondering > if I have to check something else in the header or if it is the correct > behavior: the ImageSpec structure tells me there are two channels in the > file, one called 'I' and another called 'A', which is absolutely black. (ie > empty ?) > > The file i'm opening is a simple black and white TGA used as a mask, with, > according to Gimp, photoshop, xnview, etc... a single color channel. ( 8 > bits ) > Is there a way to check if a given channel is empty ? Apparently the file > does not hold any data for alpha, so i'm wondering if OIIO is creating an > alpha channel for compatibility and if I should check some attributes to > detect if there is actually any data in it ? > > > Thanks for your help. >
_______________________________________________ Oiio-dev mailing list [email protected] http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
