#include "util.h"
#include <libcxml/cxml.h>
#include <dcp/smpte_subtitle_asset.h>
+#include <boost/algorithm/string.hpp>
using std::string;
using std::list;
shared_ptr<Content> content;
if (boost::filesystem::is_directory (path)) {
+
+ if (boost::filesystem::is_empty (path)) {
+ return shared_ptr<Content> ();
+ }
+
/* Guess if this is a DCP or a set of images: read the first ten filenames and if they
are all valid image files we assume it is a set of images.
*/
bool is_dcp = false;
int read = 0;
- for (boost::filesystem::directory_iterator i(path); i != boost::filesystem::directory_iterator() && read < 10; ++i, ++read) {
+ for (boost::filesystem::directory_iterator i(path); i != boost::filesystem::directory_iterator() && read < 10; ++i) {
+
+ if (boost::starts_with (i->path().leaf().string(), "._")) {
+ /* We ignore these files */
+ continue;
+ }
+
if (!boost::filesystem::is_regular_file (i->path()) || !valid_image_file (i->path())) {
is_dcp = true;
}
+
+ ++read;
}
if (is_dcp) {