From f6d3905e276f276ec1ca465eaad522393d95b49d Mon Sep 17 00:00:00 2001 From: Yeryeong Kim <76420409+icarusicarus@users.noreply.github.com> Date: Thu, 28 Oct 2021 05:30:45 +0900 Subject: [PATCH] Add auto detection extracted file name --- steganographer.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/steganographer.py b/steganographer.py index cc73219..b260314 100644 --- a/steganographer.py +++ b/steganographer.py @@ -301,8 +301,18 @@ def new_main(): ch = input("[?] Choose an option: ") if ch == "1": inputImagePath = input("[?] Enter the input image path: ") + inputImageName = inputImagePath.split(".") + fileFormat = inputImageName[-1] + if (len(inputImageName) > 1): + autoName = inputImagePath[:-len(inputImageName[-1]) - 1] + hiddenFilePath = input("[?] Enter the path of file to hide: ") - outputImagePath = input("[?] Enter the output image path: ") + hiddenFileName = hiddenFilePath.split(".") + if (len(hiddenFileName) > 1): + autoName = autoName + ' ' + hiddenFilePath[:-len(hiddenFileName[-1]) - 1] + autoName = autoName + '.' + fileFormat + + outputImagePath = input(f"[?] Enter the output image path: ({autoName}) ") or autoName password = input("[?] Enter password [optional]: ") print("[#] Encryption methods:")