git @ Cat's Eye Technologies kinoje / c22f828
Replace many args with --size. Give --twitter option better name. Chris Pressey 5 years ago
2 changed file(s) with 15 addition(s) and 23 deletion(s). Raw diff Collapse all Expand all
1515 delay = int(100.0 / self.options.fps)
1616
1717 filenames = [os.path.join(self.dirname, self.options.frame_fmt % f) for f in xrange(0, num_frames)]
18 if self.options.twitter:
18 if self.options.shorten_final_frame:
1919 filespec = ' '.join(filenames[:-1] + ['-delay', str(delay / 2), filenames[-1]])
2020 else:
2121 filespec = ' '.join(filenames)
4343 argparser.add_argument("--width", default=320, type=int)
4444 argparser.add_argument("--height", default=200, type=int)
4545
46 argparser.add_argument("--tiny", default=False, action='store_true')
47 argparser.add_argument("--small", default=False, action='store_true')
48 argparser.add_argument("--big", default=False, action='store_true')
49 argparser.add_argument("--huge", default=False, action='store_true')
50 argparser.add_argument("--giant", default=False, action='store_true')
46 argparser.add_argument("--size", default=None, type=str,
47 help=''
48 )
49
5150 argparser.add_argument("--square", default=False, action='store_true')
5251
5352 argparser.add_argument("--start", default=0.0, type=float, metavar='INSTANT',
7271 "the whole movie."
7372 )
7473 argparser.add_argument("--view", default=False, action='store_true')
75 argparser.add_argument("--twitter", default=False, action='store_true',
76 help="Make the last frame in a GIF animation delay only half as long."
74 argparser.add_argument("--shorten-final-frame", default=False, action='store_true',
75 help="Make the last frame in a GIF animation delay only half as long. "
76 "Might make looping smoother when uploaded to Twitter. YMMV."
7777 )
7878
7979 argparser.add_argument("--config", default=None, type=str)
8080
8181 options = argparser.parse_args(sys.argv[1:])
8282
83 if options.tiny:
84 options.width = 160
85 options.height = 100
86 if options.small:
87 options.width = 320
88 options.height = 200
89 if options.big:
90 options.width = 640
91 options.height = 400
92 if options.huge:
93 options.width = 800
94 options.height = 600
95 if options.giant:
96 options.width = 1280
97 options.height = 800
83 options.width, options.height = {
84 'tiny': (160, 100),
85 'small': (320, 200),
86 'big': (640, 400),
87 'huge': (800, 600),
88 'giant': (1280, 800),
89 }[options.size] if options.size is not None else (options.width, options.height)
9890
9991 if options.square:
10092 options.height = options.width