2 #include <boost/filesystem.hpp>
5 #include "exceptions.h"
9 using namespace libdcp;
14 cerr << "Syntax: " << n << " [OPTION] <DCP> <DCP>\n"
15 << " -v, --version show libdcp version\n"
16 << " -h, --help show this help\n"
18 << "The <DCP>s are the DCP directories to compare.\n"
19 << "Comparison is of metadata and content, ignoring timestamps\n"
20 << "and differing UUIDs.\n";
24 main (int argc, char* argv[])
26 EqualityOptions options;
30 static struct option long_options[] = {
31 { "version", no_argument, 0, 'v'},
32 { "help", no_argument, 0, 'h'},
36 int c = getopt_long (argc, argv, "vh", long_options, &option_index);
44 cout << "dcpdiff version " << LIBDCP_VERSION << "\n";
52 if (argc <= optind || argc > (optind + 2)) {
57 if (!filesystem::exists (argv[optind])) {
58 cerr << argv[0] << ": DCP " << argv[optind] << " not found.\n";
62 if (!filesystem::exists (argv[optind + 1])) {
63 cerr << argv[0] << ": DCP " << argv[optind + 1] << " not found.\n";
69 a = new DCP (argv[optind]);
71 } catch (FileError& e) {
72 cerr << "Could not read DCP " << argv[optind] << "; " << e.what() << " " << e.filename() << "\n";
78 b = new DCP (argv[optind + 1]);
80 } catch (FileError& e) {
81 cerr << "Could not read DCP " << argv[optind + 1] << "; " << e.what() << " " << e.filename() << "\n";
85 options.max_mean_pixel_error = 5;
86 options.max_std_dev_pixel_error = 5;
87 /* I think this is just below the LSB at 16-bits (ie the 8th most significant bit at 24-bit) */
88 options.max_audio_sample_error = 255;
91 bool equals = a->equals (*b, options, notes);
93 for (list<string>::iterator i = notes.begin(); i != notes.end(); ++i) {
94 cout << " " << *i << "\n";