Skip to content
This repository was archived by the owner on Jan 2, 2021. It is now read-only.

Commit 5ef872b

Browse files
committed
Add warning for files that may be too large for 4x.
1 parent a5ad2c2 commit 5ef872b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

enhance.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,12 @@ def process(self, image):
516516
else:
517517
for filename in args.files:
518518
print(filename)
519-
out = enhancer.process(scipy.ndimage.imread(filename, mode='RGB'))
519+
img = scipy.ndimage.imread(filename, mode='RGB')
520+
if img.shape[0] * img.shape[1] > 256 ** 2 and args.scales >= 2:
521+
error('This file is (probably) too large to process in one shot and was ignored.',
522+
' - Until tiled rendering is added, edit this code at your own peril!')
523+
continue
524+
525+
out = enhancer.process(img)
520526
out.save(os.path.splitext(filename)[0]+'_ne%ix.png'%(2**args.scales))
521527
print(ansi.ENDC)

0 commit comments

Comments
 (0)