diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-09-24 23:49:53 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-09-24 23:49:53 +0100 |
| commit | 4fd257106009b2db170dafddece06ee3c190fceb (patch) | |
| tree | 7c76eb39f2981e4d492404dcc0966de10eb83eb3 /src/lib/image.cc | |
| parent | 45698c6bc5cd3a596e7f0c963733d502c11dd854 (diff) | |
Remove long-since disused hash debugging.
Diffstat (limited to 'src/lib/image.cc')
| -rw-r--r-- | src/lib/image.cc | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/src/lib/image.cc b/src/lib/image.cc index f16bb9f77..89536da33 100644 --- a/src/lib/image.cc +++ b/src/lib/image.cc @@ -27,6 +27,7 @@ #include <sys/time.h> #include <boost/algorithm/string.hpp> #include <openjpeg.h> +#include <mhash.h> extern "C" { #include <libavcodec/avcodec.h> #include <libavformat/avformat.h> @@ -39,10 +40,6 @@ extern "C" { #include "exceptions.h" #include "scaler.h" -#ifdef DEBUG_HASH -#include <mhash.h> -#endif - using namespace std; using namespace boost; @@ -85,33 +82,6 @@ Image::components () const return 0; } -#ifdef DEBUG_HASH -/** Write a MD5 hash of the image's data to stdout. - * @param n Title to give the output. - */ -void -Image::hash (string n) const -{ - MHASH ht = mhash_init (MHASH_MD5); - if (ht == MHASH_FAILED) { - throw EncodeError ("could not create hash thread"); - } - - for (int i = 0; i < components(); ++i) { - mhash (ht, data()[i], line_size()[i] * lines(i)); - } - - uint8_t hash[16]; - mhash_deinit (ht, hash); - - printf ("%s: ", n.c_str ()); - for (int i = 0; i < int (mhash_get_block_size (MHASH_MD5)); ++i) { - printf ("%.2x", hash[i]); - } - printf ("\n"); -} -#endif - /** Scale this image to a given size and convert it to RGB. * @param out_size Output image size in pixels. * @param scaler Scaler to use. |
