我一直在試圖從一個目錄做多張圖片隱寫術,並使用Stegano模塊將它們保存在另一個。Stegano:多幅圖像中嵌入相同的祕密返回錯誤結果
我已經想出了代碼:
from stegano import slsb
import os, sys
APP_ROOT = os.path.dirname(os.path.abspath(__file__))
path = os.path.join(APP_ROOT, 'current_folder/')
dirs = os.listdir(path)
new_path = os.path.join(APP_ROOT, 'new_folder/')
dirs2 = os.listdir(new_path)
def stegogal():
for item in dirs:
if os.path.isfile(path+item):
sw = "secretword"
f, e = os.path.splitext(path+item+'.png')
secret = slsb.hide(f, sw)
f, e = os.path.splitext(new_path+item+'.png')
secret.save(f + '_G.png')
stegogal()
然而,在幾乎所有的圖像的祕密世界(3選2)將被以某種方式搞砸了。例如它將隱藏"secretworg"
而不是"secretword"
。
有人能向我解釋什麼,似乎是這個問題,或許顯示出一些更好的方式來做到這一點?
只是更新stegano模塊 – cutzero