/*
- Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2017 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
{
dcpomatic_setup ();
- Config::instance()->set_num_local_encoding_threads (1);
+ Config::instance()->set_master_encoding_threads (1);
+ Config::instance()->set_server_encoding_threads (1);
Config::instance()->set_server_port_base (61921);
Config::instance()->set_default_isdcf_metadata (ISDCFMetadata ());
Config::instance()->set_default_container (Ratio::from_id ("185"));
}
void
-check_audio_file (boost::filesystem::path ref, boost::filesystem::path check)
+check_wav_file (boost::filesystem::path ref, boost::filesystem::path check)
{
SF_INFO ref_info;
ref_info.format = 0;
}
}
+void
+check_image (boost::filesystem::path ref, boost::filesystem::path check)
+{
+#ifdef DCPOMATIC_IMAGE_MAGICK
+ using namespace MagickCore;
+#else
+ using namespace MagickLib;
+#endif
+
+ Magick::Image ref_image;
+ ref_image.read (ref.string ());
+ Magick::Image check_image;
+ check_image.read (check.string ());
+ BOOST_CHECK_MESSAGE (ref_image.compare (check_image), ref << " differs from " << check);
+}
+
void
check_file (boost::filesystem::path ref, boost::filesystem::path check)
{
}
void
-write_image (shared_ptr<const Image> image, boost::filesystem::path file)
+write_image (shared_ptr<const Image> image, boost::filesystem::path file, string format)
{
#ifdef DCPOMATIC_IMAGE_MAGICK
using namespace MagickCore;
using namespace MagickLib;
#endif
- Magick::Image m (image->size().width, image->size().height, "ARGB", CharPixel, (void *) image->data()[0]);
+ Magick::Image m (image->size().width, image->size().height, format.c_str(), CharPixel, (void *) image->data()[0]);
m.write (file.string ());
}