YassineYousfi commited on
Commit
f731703
·
1 Parent(s): 2238157

raise value error

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -28,9 +28,12 @@ def HILL(input_image, operation, message, key):
28
  cv2.imwrite('tmp/'+tmp_name+'.png',I)
29
 
30
  if operation == 'decode':
31
- stc.extract('tmp/'+tmp_name+'.png', key, 'tmp/'+tmp_name+'.txt')
32
- return 'tmp/'+tmp_name+'.txt'
33
-
 
 
 
34
  else:
35
  H = np.array(
36
  [[-1, 2, -1],
 
28
  cv2.imwrite('tmp/'+tmp_name+'.png',I)
29
 
30
  if operation == 'decode':
31
+ try:
32
+ stc.extract('tmp/'+tmp_name+'.png', key, 'tmp/'+tmp_name+'.txt')
33
+ return 'tmp/'+tmp_name+'.txt'
34
+ except:
35
+ raise ValueError('Unable to decode')
36
+
37
  else:
38
  H = np.array(
39
  [[-1, 2, -1],