X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fimage_examiner.cc;h=5a1672204d4f67d6adfa2162707df456bc3595bc;hb=26866fdeba6dd868b1809de49799690555164f70;hp=acbf55696271daa84588b179debdb60bcae0e439;hpb=eedce87b88d65b89c13e8bea4ad587cace8df44a;p=dcpomatic.git diff --git a/src/lib/image_examiner.cc b/src/lib/image_examiner.cc index acbf55696..5a1672204 100644 --- a/src/lib/image_examiner.cc +++ b/src/lib/image_examiner.cc @@ -19,16 +19,16 @@ */ -#include "image_content.h" -#include "image_examiner.h" -#include "film.h" -#include "job.h" -#include "exceptions.h" +#include "compose.hpp" #include "config.h" #include "cross.h" -#include "compose.hpp" +#include "exceptions.h" #include "ffmpeg_image_proxy.h" +#include "film.h" #include "image.h" +#include "image_content.h" +#include "image_examiner.h" +#include "job.h" #include #include #include @@ -39,8 +39,8 @@ using std::cout; using std::list; -using std::sort; using std::shared_ptr; +using std::sort; using boost::optional; @@ -55,19 +55,17 @@ ImageExaminer::ImageExaminer (shared_ptr film, shared_ptr buffer(size); + checked_fread (buffer.data(), size, f, path); fclose (f); try { - _video_size = dcp::decompress_j2k (buffer, size, 0)->size (); + _video_size = dcp::decompress_j2k(buffer.data(), size, 0)->size(); } catch (dcp::ReadError& e) { - delete[] buffer; throw DecodeError (String::compose (_("Could not decode JPEG2000 file %1 (%2)"), path, e.what ())); } - delete[] buffer; } else { - FFmpegImageProxy proxy(content->path(0), content->video->range()); - _video_size = proxy.image().image->size(); + FFmpegImageProxy proxy(content->path(0)); + _video_size = proxy.image(Image::Alignment::COMPACT).image->size(); } if (content->still ()) {