fix fsr sharpening regardless of cli option

This commit is contained in:
2023-05-16 17:27:09 +02:00
parent 254e0cf669
commit 7043cad015
2 changed files with 24 additions and 12 deletions

View File

@@ -254,12 +254,29 @@ class Handler:
self.filelist.pop(0) self.filelist.pop(0)
self.filelist.sort() self.filelist.sort()
self.number = 0 self.number = 0
if sharpening != '' and sharpening != None:
for self.file in self.filelist: for self.file in self.filelist:
self.number += 1 self.number += 1
if ( self.os_type == 'win32' ): if ( self.os_type == 'win32' ):
self.file_list.append( f"{tmppath}{self.file} {tmppath}us\\ig{str(self.number).zfill(8)}.{ filetype } " ); self.file_list.append( f"{tmppath}{self.file} {tmppath}us\\ig{str(self.number).zfill(8)}.{ filetype } " );
else: else:
self.file_list.append( f"{tmppath}{self.file} {tmppath}us/ig{str(self.number).zfill(8)}.{ filetype } " ); self.file_list.append( f"{tmppath}{self.file} {tmppath}us/ig{str(self.number).zfill(8)}.{ filetype } " );
try:
os.mkdir( f'{tmppath}us' )
except FileExistsError:
pass
else:
for self.file in self.filelist:
self.number += 1
if ( self.os_type == 'win32' ):
self.file_list.append( f"{tmppath}{self.file} {tmppath}sc\\ig{str(self.number).zfill(8)}.{ filetype } " );
else:
self.file_list.append( f"{tmppath}{self.file} {tmppath}sc/ig{str(self.number).zfill(8)}.{ filetype } " );
try:
os.mkdir( f'{tmppath}sc' )
except FileExistsError:
pass
if ( self.os_type == 'win32' ): if ( self.os_type == 'win32' ):
self.maxlength = 8000 self.maxlength = 8000
@@ -267,11 +284,6 @@ class Handler:
self.maxlength = 31900 self.maxlength = 31900
self.pos = 1 self.pos = 1
try:
os.mkdir( f'{tmppath}us' )
except FileExistsError:
pass
############################################ ############################################
# #
# Thread optimisation: Divide workload up into different threads & upscale using helper function # Thread optimisation: Divide workload up into different threads & upscale using helper function
@@ -303,7 +315,7 @@ class Handler:
self.pool.close(); self.pool.close();
self.pool.join(); self.pool.join();
if sharpening != '': if sharpening != '' and sharpening != None:
print( f'\n\n\n==> Sharpening using { self.threads } threads <==\n\n' ); print( f'\n\n\n==> Sharpening using { self.threads } threads <==\n\n' );
time.sleep( 2 ); time.sleep( 2 );