Omnibus commited on
Commit
fdf1c92
·
1 Parent(s): b02fde6

Update stegan2.py

Browse files
Files changed (1) hide show
  1. stegan2.py +3 -3
stegan2.py CHANGED
@@ -40,15 +40,15 @@ def decode(image_name,txt=None):
40
  decoded_data += chr(int(byte, 2))
41
  if decoded_data[-5:] == "=====":
42
  break
43
- p = decoded_data[:-5].split("#####",1)[1].split("#####",1)[0]
44
  #if p == resultd:
45
- this = decoded_data[:-5].split("#",1)[0]
46
  #base = bytes(this, 'utf-8')
47
  #with open(f"finished_im{uniqnum}.png", "wb") as fh:
48
  # fh.write(base64.decodebytes(bytes(this, 'utf-8')))
49
  #fh.close
50
  #return f"finished_im{uniqnum}.png"
51
- return p
52
 
53
  def encode(image_name, secret_data,txt=None):
54
  BGRimage = cv2.imread(image_name)
 
40
  decoded_data += chr(int(byte, 2))
41
  if decoded_data[-5:] == "=====":
42
  break
43
+ #p = decoded_data[:-5].split("#####",1)[1].split("#####",1)[0]
44
  #if p == resultd:
45
+ this = decoded_data[:-5].split("#####",1)[0]
46
  #base = bytes(this, 'utf-8')
47
  #with open(f"finished_im{uniqnum}.png", "wb") as fh:
48
  # fh.write(base64.decodebytes(bytes(this, 'utf-8')))
49
  #fh.close
50
  #return f"finished_im{uniqnum}.png"
51
+ return this
52
 
53
  def encode(image_name, secret_data,txt=None):
54
  BGRimage = cv2.imread(image_name)