16 lines
557 B
Python
16 lines
557 B
Python
import dcc.config
|
|
import dcc.doom_base
|
|
import wand.image
|
|
|
|
class SS(dcc.doom_base.WadMap):
|
|
def get_parser(self, prog_name):
|
|
parser = super().get_parser(prog_name)
|
|
parser.add_argument("-g", "--gravity", default="center")
|
|
return parser
|
|
|
|
def take_action(self, parsed_args):
|
|
with wand.image.Image(width=THUMB_WIDTH, height=THUMB_HEIGHT, pseudo="x:") as img:
|
|
img.reset_coords()
|
|
img.crop(width=THUMB_WIDTH,height=THUMB_HEIGHT,gravity="center")
|
|
img.reset_coords()
|
|
img.save(filename=dcc.config.BaseThumbPath(parsed_args.wad, parsed_args.map))
|