+2013-12-28 Carl Hetherington <cth@carlh.net>
+
+ * Fix failure to load films with missing still image content (#300).
+
2013-12-27 Carl Hetherington <cth@carlh.net>
* Fix non-update of video information on changing DCP resolution (#299).
}
bool
-Content::path_valid () const
+Content::paths_valid () const
{
for (vector<boost::filesystem::path>::const_iterator i = _paths.begin(); i != _paths.end(); ++i) {
if (!boost::filesystem::exists (*i)) {
return _paths[i];
}
- bool path_valid () const;
+ bool paths_valid () const;
/** @return MD5 digest of the content's file(s) */
std::string digest () const {
return _playlist->best_dcp_frame_rate ();
}
-bool
-Film::content_paths_valid () const
-{
- return _playlist->content_paths_valid ();
-}
-
void
Film::playlist_content_changed (boost::weak_ptr<Content> c, int p)
{
Time length () const;
bool has_subtitles () const;
OutputVideoFrame best_video_frame_rate () const;
- bool content_paths_valid () const;
libdcp::KDM
make_kdm (
return;
}
- Magick::Image* magick_image = new Magick::Image (_image_content->path (_image_content->still() ? 0 : _video_position).string ());
+ Magick::Image* magick_image = 0;
+ boost::filesystem::path const path = _image_content->path (_image_content->still() ? 0 : _video_position);
+ try {
+ magick_image = new Magick::Image (path.string ());
+ } catch (...) {
+ throw OpenFileError (path);
+ }
+
libdcp::Size size (magick_image->columns(), magick_image->rows());
_image.reset (new Image (PIX_FMT_RGB24, size, true));
Changed ();
}
-
-bool
-Playlist::content_paths_valid () const
-{
- for (ContentList::const_iterator i = _content.begin(); i != _content.end(); ++i) {
- if (!(*i)->path_valid ()) {
- return false;
- }
- }
-
- return true;
-}
void repeat (ContentList, int);
- bool content_paths_valid () const;
-
mutable boost::signals2::signal<void ()> Changed;
/** Third parameter is true if signals are currently being emitted frequently */
mutable boost::signals2::signal<void (boost::weak_ptr<Content>, int, bool)> ContentChanged;
_join->Enable (n > 1);
- _find_missing->Enable (_content.size() == 1 && !_content.front()->path_valid ());
+ _find_missing->Enable (_content.size() == 1 && !_content.front()->paths_valid ());
_remove->Enable (!_content.empty ());
_parent->PopupMenu (_menu, p);
}
ContentList content = _film->content ();
for (ContentList::iterator i = content.begin(); i != content.end(); ++i) {
int const t = _content->GetItemCount ();
- bool const valid = (*i)->path_valid ();
+ bool const valid = (*i)->paths_valid ();
string s = (*i)->summary ();
if (!valid) {