Commits

Cédric Bonhomme committed dbab9e7

Raise an exception if the message to hide is too long. resolves #1

Comments (0)

Files changed (1)

 #-*- coding: utf-8 -*-
 
 # Stéganô - Stéganô is a basic Python Steganography module.
-# Copyright (C) 2010-2013  Cédric Bonhomme - http://cedricbonhomme.org/
+# Copyright (C) 2010-2011  Cédric Bonhomme - http://cedricbonhomme.org/
 #
 # For more information : http://bitbucket.org/cedricbonhomme/stegano/
 #
 
     npixels = width * height
     if len(message_bits) > npixels * 3:
-        return """Too long message (%s > %s).""" % (len(message_bits), npixels * 3)
+        raise Exception("""The message you want to hide is too long (%s > %s).""" % (len(message_bits), npixels * 3))
 
     for row in xrange(height):
         for col in xrange(width):
             with open(options.secret_binary, "w") as f:
                 f.write(data)
         else:
-            print secret
+            print secret