X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fimage_examiner.cc;h=5a1672204d4f67d6adfa2162707df456bc3595bc;hb=925d97b8e51421bf509c5ffbe4abe8f77a6ca95e;hp=ae12d7adb3570363304326250fe55474b3827039;hpb=952084c4221c5708e02c783284cf0f7239c6b4c4;p=dcpomatic.git diff --git a/src/lib/image_examiner.cc b/src/lib/image_examiner.cc index ae12d7adb..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,16 +55,14 @@ 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)); _video_size = proxy.image(Image::Alignment::COMPACT).image->size();