summaryrefslogtreecommitdiff
path: root/src/lib/image_decoder.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/image_decoder.cc')
-rw-r--r--src/lib/image_decoder.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/image_decoder.cc b/src/lib/image_decoder.cc
index d0973f122..f7afbc0a1 100644
--- a/src/lib/image_decoder.cc
+++ b/src/lib/image_decoder.cc
@@ -55,10 +55,18 @@ ImageDecoder::pass (PassReason, bool)
/* Either we need an image or we are using moving images, so load one */
boost::filesystem::path path = _image_content->path (_image_content->still() ? 0 : _video_position);
if (valid_j2k_file (path)) {
+ AVPixelFormat pf;
+ if (_image_content->video->colour_conversion()) {
+ /* We have a specified colour conversion: assume the image is RGB */
+ pf = AV_PIX_FMT_RGB48LE;
+ } else {
+ /* No specified colour conversion: assume the image is XYZ */
+ pf = AV_PIX_FMT_XYZ12LE;
+ }
/* We can't extract image size from a JPEG2000 codestream without decoding it,
so pass in the image content's size here.
*/
- _image.reset (new J2KImageProxy (path, _image_content->video->size ()));
+ _image.reset (new J2KImageProxy (path, _image_content->video->size(), pf));
} else {
_image.reset (new MagickImageProxy (path));
}