Improve ignore_first logic

This commit is contained in:
James Betker 2020-11-03 11:56:32 -07:00
parent 658a267bab
commit e990be0449

View File

@ -10,10 +10,7 @@ class ChunkWithReference:
self.tiles, _ = util.get_image_paths('img', self.path) self.tiles, _ = util.get_image_paths('img', self.path)
self.strict = opt['strict'] if 'strict' in opt.keys() else True self.strict = opt['strict'] if 'strict' in opt.keys() else True
if 'ignore_first' in opt.keys(): if 'ignore_first' in opt.keys():
self.ignore = opt['ignore_first'] self.tiles = self.tiles[opt['ignore_first']:]
self.tiles = self.tiles[self.ignore:]
else:
self.ignore = 0
# Odd failures occur at times. Rather than crashing, report the error and just return zeros. # Odd failures occur at times. Rather than crashing, report the error and just return zeros.
def read_image_or_get_zero(self, img_path): def read_image_or_get_zero(self, img_path):