fix #2024 (TODO - avoid image copy for lossy encoding of views)