Make DCPExaminer::size() optional and deal with the consequences.
[dcpomatic.git] / src / lib / image_examiner.cc
index 6e4dea7b7da6f1ddc104341f5a8c5bf415475578..15a0b043d56543c8451cfd243c27204afc336f16 100644 (file)
@@ -31,6 +31,7 @@
 #include "job.h"
 #include <dcp/openjpeg_image.h>
 #include <dcp/exceptions.h>
+#include <dcp/filesystem.h>
 #include <dcp/j2k_transcode.h>
 #include <iostream>
 
@@ -50,7 +51,7 @@ ImageExaminer::ImageExaminer (shared_ptr<const Film> film, shared_ptr<const Imag
 {
        auto path = content->path(0);
        if (valid_j2k_file (path)) {
-               auto size = boost::filesystem::file_size (path);
+               auto size = dcp::filesystem::file_size(path);
                dcp::File f(path, "rb");
                if (!f) {
                        throw FileError ("Could not open file for reading", path);
@@ -76,10 +77,10 @@ ImageExaminer::ImageExaminer (shared_ptr<const Film> film, shared_ptr<const Imag
 }
 
 
-dcp::Size
+optional<dcp::Size>
 ImageExaminer::video_size () const
 {
-       return _video_size.get ();
+       return _video_size;
 }