From 050d936f2b620903ada0740f9bc226100989e38c Mon Sep 17 00:00:00 2001 From: Dan Dembinski Date: Wed, 16 Jun 2021 10:25:49 -0400 Subject: [PATCH] fixed jpgs including pdf in filename --- Thumbnails.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Thumbnails.py b/Thumbnails.py index 22f89f5..3d1bb90 100644 --- a/Thumbnails.py +++ b/Thumbnails.py @@ -1,8 +1,9 @@ import pdf2image, shutil, sys, os, logging file = sys.argv[1] -outfile = os.path.basename(file) -outputPath = 'C:\\Images\\IDV2ICP\\' +outfile = os.path.splitext(os.path.basename(file))[0] +#outputPath = 'C:\\Images\\IDV2ICP\\' +outputPath = 'C:\\Users\\ddembinski\\Desktop\\FOMO\\' uploadPath = os.path.dirname(file) logging.basicConfig(filename='ICPThumbnails.log', format='%(asctime)s - %(message)s', @@ -35,7 +36,7 @@ try: if not os.path.isdir(uploadPath + '\\Archive'): os.mkdir(uploadPath + '\\Archive') - shutil.move(file, uploadPath + '\\Archive\\' + str(outfile)) + shutil.move(file, uploadPath + '\\Archive\\' + str(outfile) + '.pdf') logging.info('%s - Converted' % (file)) @@ -43,4 +44,4 @@ except Exception as e: logging.info('%s - conversion failed' % (file)) if not os.path.isdir(uploadPath + '\\Exception'): os.mkdir(uploadPath + '\\Exception') - shutil.move(file, uploadPath + '\\Exception\\' + str(outfile)) \ No newline at end of file + shutil.move(file, uploadPath + '\\Exception\\' + str(outfile) + '.pdf') \ No newline at end of file