/*
 * Test program for the class ImageResizer
 *
 * $Date$
 * $Revision$
 *
 */

#ifdef NDEBUG
#undef NDEBUG
#endif /* NDEBUG */

#include <iostream>

#ifdef MAGICK_INTER
// if this feature is not available, we don't do anything!

#include "WImage/MagickInter.hh"
#include "testing.h"
#include <cassert>
#include <memory>
#include <stdexcept>

#if !(defined __WATCOMC__ && __WATCOMC__ < 1230)
using namespace std;
#endif

namespace Magick {
  void InitializeMagick (const char *path);
}

int
main (void)
{
  Magick::InitializeMagick (NULL);
  cout << "Testing MagickInter utilities...\n";

  std::auto_ptr<ColorImage> ip1 (NEW (ColorImage ()));
  TEST_NO_EXCEPTION (ip1->read ("christina57.jpg")); // 594x448
  TEST_NO_EXCEPTION (MagickInter::writeColorImage (*ip1, "out.png"));
  std::auto_ptr<ColorImage> ip2 = MagickInter::obtainColorImage ("out.png");
  TEST_ASSERT(ip1->epsilons (*ip2, 0.01));

  cout << "done.\n";
  return 0;
}

#else

int
main (void)
{
  std::cout << "No MagickInter support, nothting to do!" << std::endl;
  return 0;
}

#endif
