Hi,

A while ago, I had an issue with single channel tiff files ( crash in alpha premult ), which I fixed by setting
"oiio:UnassociatedAlpha" =  1 in the spec config.

Weird thing is, I kept getting crashes with another file that declares multiple channels, in the same premult function. In my code, I read channel by channel, so I have multiple calls to TIFFInput::read_scanline, with chbegin = chend each time.

After a bit of debug, I found that the first time I call the function, the m_convert_alpha boolean is correctly set to false. However, in the second call, it get erased in ImageInput::read_scanlines and is set to true.

The issue comes from the way the read_native_scanline function is coded: if we request a scanline that we have already read, we close the file and reopened it using this calls:
if (! close ()  ||
        ! open (m_filename, dummyspec)  ||
        ! seek_subimage (old_subimage, old_miplevel, dummyspec)) {
        return false;    // Somehow, the re-open failed
}


So obviously, the current config paremeters are lost. Isn't it possible rewind instead of reopening the file ?


Second question: can the premult work when reading channel per channel ? Naively I'd say that it can't: we may not have the data in memory.

Michel
_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to