ImageSpec::get_channelformats should be const.