Hi,
I am not overtly familiar with this code, but some things took my
attention:
if (specs[0].deep)
filetype = specs[0].tile_width ? "tiledimage" : "deepscanlineimage";
else
filetype = specs[0].tile_width ? "tiledimage" : "scanlineimage";
//L460
In the deep, tiled case is there a good reason not to set the filetype to
be deeptiledimage? That is alluded to later on in the code. And indeed,
from the code snippet, I can't see how filetype gets used.
Also, the following message:
error ("OpenEXR does not support mixed deep/nondeep multi-part
image files");
Maybe I am interpreting the message incorrectly, but OpenEXR can support a
mixture of flat and deep images, the restriction being that each different
type must be in a separate part.
Thanks
Piotr
On 18 November 2013 05:24, Michel Lerenard <[email protected]>wrote:
> Hi,
>
>
> while trying to understand why some of our EXR files could not be
> correctly opened by other application, i had a look in the
> OpenEXROutput::open function and there's something I don't get: we do not
> seem to be setting the type of the image if we have 1 subimage and no deep
> image.
>
>
> Here's the bit of code (L457)
> std::string filetype;//L457
> if (specs[0].deep)
> filetype = specs[0].tile_width ? "tiledimage" :
> "deepscanlineimage";
> else
> filetype = specs[0].tile_width ? "tiledimage" : "scanlineimage";
> //L460
> bool deep = false;
> for (int s = 0; s < subimages; ++s) {
> if (! spec_to_header (m_subimagespecs[s], m_headers[s]))
> return false;
> deep |= m_subimagespecs[s].deep;
> if (m_subimagespecs[s].deep != m_subimagespecs[0].deep) {
> error ("OpenEXR does not support mixed deep/nondeep multi-part
> image files");
> return false;
> }
> if (subimages > 1 || deep) {//L470
> bool tiled = m_subimagespecs[s].tile_width;
> m_headers[s].setType (deep ? (tiled ? Imf::DEEPTILE :
> Imf::DEEPSCANLINE)
> : (tiled ? Imf::TILEDIMAGE :
> Imf::SCANLINEIMAGE));
> }
> }
>
> filetype does not seem to be used, and the values that we put into it are
> exactly the ones defined by the Imf constants.
>
> As far as I can see, we can remove L456->460, and remove the test L470.
>
> Any thoughts ?
>
>
>
> Michel
>
> _______________________________________________
> Oiio-dev mailing list
> [email protected]
> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
>
_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org