Here's the PR that fixes the weirdness with --ch: https://github.com/OpenImageIO/oiio/pull/1326
> On Jan 22, 2016, at 3:08 PM, Larry Gritz <[email protected]> wrote: > > Aha, I see where it's going wrong. The --ch (and underlying > ImageBufAlgo::channels() function) notices when you have requested a channel > order that doesn't actually change the ordering, and so takes an "early out" > rather than copy channel data all over the place for no good reason. It's > failing to notice that you may not be changing the order, but you are > changing the names. > > I'll prepare a separate fix for that, but in the mean time --chnames is the > way to go when you are only renaming channels but not changing their order. > (--ch would work for renaming, if only at least one channel has its order > changed as well.) > > Sorry for the confusion. > > -- lg > > >> On Jan 22, 2016, at 2:52 PM, Larry Gritz <[email protected]> wrote: >> >> If you're just renaming channels in order, this works: >> >> oiiotool in.exr --chnames x,y,z -o out.exr >> >> That should get you unstuck. (I don't remember exactly when --chnames was >> added, sufficiently old versions may lack it.) Meanwhile, I'll look at --ch >> and see if I can't figure out why that isn't working. >> >> Note, however, that channel names work strangely in OpenEXR. There is no >> canonical numerical order in exr, other than alphabetical by channel name. >> But OIIO says that on the app side of an API, RGBAZ always come first, so >> OIIO will reorder the presentation of channels for you (though not their >> actual order in the file). So, oddly, if you "oiiotool -info -v out.exr" in >> the example above, it will report channels "z, x, y". Because it thinks Z is >> depth, and puts it before "other things it doesn't recognize". So just >> beware of this, it's saving the file correctly, but your particular choice >> of channel names is defeating the presentation heuristic that is almost >> always preferable to alphabetical order. >> >> >> >>> On Jan 22, 2016, at 2:42 PM, Larry Gritz <[email protected]> wrote: >>> >>> Never mind. I can reproduce this. Hang on... >>> >>> >>> >>>> On Jan 22, 2016, at 2:33 PM, Larry Gritz <[email protected]> wrote: >>>> >>>> Is it still a problem in 1.6 and/or master? >>>> >>>> >>>>> On Jan 20, 2016, at 11:12 PM, Daniel Flood <[email protected]> >>>>> wrote: >>>>> >>>>> Hi folks, >>>>> >>>>> I'm trying to use oiiotool to take an rgb exr, and change the channel >>>>> names to some arbitrary value, while preserving compression type and >>>>> header metadata. >>>>> >>>>> I tried this, and noticed different results in oiio 1.2 and 1.5. in.exr >>>>> is a rgb exr. >>>>> >>>>> oiiotool in.exr --ch "x=R,y=G,z=B" -o out.exr >>>>> >>>>> In 1.2, this creates an empty exr with the correct channel names (ie >>>>> xyz), but no image. In 1.5 it creates the image, but the channels are >>>>> RGB. >>>>> >>>>> Can someone point me in the right direction for this? The reason is >>>>> interfacing with external software which expects channel names to be >>>>> certain values. >>>>> >>>>> cheers, >>>>> Dan >>>>> >>>>> >>>> >>>> -- >>>> Larry Gritz >>>> [email protected] >>>> >>>> >>>> _______________________________________________ >>>> Oiio-dev mailing list >>>> [email protected] >>>> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org >>> >>> -- >>> Larry Gritz >>> [email protected] >>> >>> >>> _______________________________________________ >>> Oiio-dev mailing list >>> [email protected] >>> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org >> >> -- >> Larry Gritz >> [email protected] >> >> >> _______________________________________________ >> Oiio-dev mailing list >> [email protected] >> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org > > -- > Larry Gritz > [email protected] > > > _______________________________________________ > Oiio-dev mailing list > [email protected] > http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org -- Larry Gritz [email protected] _______________________________________________ Oiio-dev mailing list [email protected] http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
