diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-01-06 11:06:40 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-01-06 11:06:40 +0000 |
| commit | 89f66ac25a5fffa04cf3abc569a0b4eaf7259320 (patch) | |
| tree | 6a3bfbad7219a80adff5099fa82517e927eedf61 | |
| parent | 233d05d1c56eb31863cd5452e05a35ed881f671e (diff) | |
Don't bother checking image counts for still-as-moving images; it seems a bit pointless.
| -rw-r--r-- | ChangeLog | 2 | ||||
| -rw-r--r-- | src/lib/image_examiner.cc | 34 |
2 files changed, 6 insertions, 30 deletions
@@ -1,5 +1,7 @@ 2014-01-06 Carl Hetherington <cth@carlh.net> + * Remove seemingly unnecessary checks on image directories. + * Leave DCP directory creation until the last minute to help avoid half-eaten directories being left around (#174). diff --git a/src/lib/image_examiner.cc b/src/lib/image_examiner.cc index 2d150583a..17064fd45 100644 --- a/src/lib/image_examiner.cc +++ b/src/lib/image_examiner.cc @@ -41,36 +41,10 @@ ImageExaminer::ImageExaminer (shared_ptr<const Film> film, shared_ptr<const Imag , _image_content (content) , _video_length (0) { - list<unsigned int> frames; - size_t const N = content->number_of_paths (); - - for (size_t i = 0; i < N; ++i) { - boost::filesystem::path const p = content->path (i); - try { - frames.push_back (lexical_cast<int> (p.stem().string())); - } catch (bad_lexical_cast &) { - /* We couldn't turn that filename into a number; never mind */ - } - - if (!_video_size) { - using namespace MagickCore; - Magick::Image* image = new Magick::Image (p.string()); - _video_size = libdcp::Size (image->columns(), image->rows()); - delete image; - } - - job->set_progress (float (i) / N); - } - - frames.sort (); - - if (N > 1 && frames.front() != 0 && frames.front() != 1) { - throw StringError (String::compose (_("first frame in moving image directory is number %1"), frames.front ())); - } - - if (N > 1 && frames.back() != frames.size() && frames.back() != (frames.size() - 1)) { - throw StringError (String::compose (_("there are %1 images in the directory but the last one is number %2"), frames.size(), frames.back ())); - } + using namespace MagickCore; + Magick::Image* image = new Magick::Image (content->path(0).string()); + _video_size = libdcp::Size (image->columns(), image->rows()); + delete image; if (content->still ()) { _video_length = Config::instance()->default_still_length() * video_frame_rate(); |
