MCPcopy Create free account
hub / github.com/LCBOWER33/StegoScan / extract_from_file

Function extract_from_file

StegoScan.py:599–625  ·  view source on GitHub ↗
(output_dir)

Source from the content-addressed store, hash-verified

597
598
599def extract_from_file(output_dir):
600 pdf_dir = os.path.join(output_dir, "pdf")
601 os.makedirs(pdf_dir, exist_ok=True)
602
603 docx_dir = os.path.join(output_dir, "docx")
604 os.makedirs(docx_dir, exist_ok=True)
605
606 png_dir = os.path.join(output_dir, "png")
607 os.makedirs(png_dir, exist_ok=True)
608
609 for filename in os.listdir(pdf_dir):
610 f = os.path.join(pdf_dir, filename)
611 # checking if it is a file
612 # print("IN PDF")
613 if os.path.isfile(f):
614 prGreen(f)
615 extract_images_from_pdf(f, output_dir)
616
617 # print("OUT")
618
619 """for filename in os.listdir(docx_dir):
620 f = os.path.join(docx_dir, filename)
621 # checking if it is a file
622 print("IN DOCX")
623 if os.path.isfile(f):
624 # print(f)
625 extract_images_from_docx(f, png_dir)"""
626
627def clean_up_folder(target_dir):
628 if not os.path.isdir(target_dir):

Callers 2

start_progressFunction · 0.85
mainFunction · 0.85

Calls 2

prGreenFunction · 0.85
extract_images_from_pdfFunction · 0.85

Tested by

no test coverage detected