X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fimage_examiner.cc;h=7b02de956e033ff14a60810f732d82b6774412a6;hb=6fde557864505b470c438e4161ee494f29b90d63;hp=b2f9623238814dd090f2d27cdcb7cfb7e774d0e1;hpb=6e10de6161f783de85bbaf59824a29026d524e55;p=dcpomatic.git diff --git a/src/lib/image_examiner.cc b/src/lib/image_examiner.cc index b2f962323..7b02de956 100644 --- a/src/lib/image_examiner.cc +++ b/src/lib/image_examiner.cc @@ -24,8 +24,10 @@ #include "exceptions.h" #include "config.h" #include "cross.h" +#include "compose.hpp" #include #include +#include #include #include @@ -41,13 +43,13 @@ ImageExaminer::ImageExaminer (shared_ptr film, shared_ptrpath(0).string (); if (valid_j2k_file (path)) { boost::uintmax_t size = boost::filesystem::file_size (path); - FILE* f = fopen_boost (path, "r"); + FILE* f = fopen_boost (path, "rb"); if (!f) { throw FileError ("Could not open file for reading", path); } @@ -68,7 +70,7 @@ ImageExaminer::ImageExaminer (shared_ptr film, shared_ptrstill ()) { - _video_length = Config::instance()->default_still_length() * video_frame_rate().get_value_or (24); + _video_length = Config::instance()->default_still_length() * video_frame_rate().get_value_or (film->video_frame_rate ()); } else { _video_length = _image_content->number_of_paths (); } @@ -80,9 +82,24 @@ ImageExaminer::video_size () const return _video_size.get (); } -optional +optional ImageExaminer::video_frame_rate () const { + if (_image_content->has_own_video_frame_rate()) { + /* The content already knows what frame rate it should be */ + return _image_content->video_frame_rate(); + } + /* Don't know */ - return optional (); + return optional (); +} + +bool +ImageExaminer::yuv () const +{ + /* We never convert ImageSource from YUV to RGB (though maybe sometimes we should) + so it makes sense to just say they are never YUV so the option of a conversion + to RGB is not offered. + */ + return false; }