diff --git a/colorhash/matricizer.py b/colorhash/matricizer.py index ce9a1b1..d3186b0 100644 --- a/colorhash/matricizer.py +++ b/colorhash/matricizer.py @@ -87,6 +87,8 @@ class NibbleMatricizer(Matricizer): """ algo = detect_hash_algorithm(data) + if algo is None: + raise ValueError("unable to determine hash algorithm") w, h = self.DIMENSIONS[algo] nibbles = [] @@ -152,6 +154,8 @@ class RandomartMatricizer(Matricizer): :returns: the matrix converted from the hash data. """ algo = detect_hash_algorithm(data) + if algo is None: + raise ValueError("unable to determine hash algorithm") w, h = self.DIMENSIONS[algo] rows = [[0] * w for _ in range(h)] diff --git a/examples/commithash.svg b/examples/commithash.svg index debd3f4..64b9870 100644 --- a/examples/commithash.svg +++ b/examples/commithash.svg @@ -1,42 +1,42 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file