示例#1
0
def prompt_compare(snapshot_mov_filename, snapshot_md5_filename, filename):
    # if not open the video using the player
    # TODO: make platform agnostic
    os.system("open %s" % filename)
    os.system("open %s" % snapshot_mov_filename)
    # warn if it's rotated
    try:
        rotation = effects.get_rotation(filename)
        print "snapshot: rotation is", rotation
    except:
        pass
    # and ask if it looks OK?
    ok = query_yes_no("snapshot: New/changed snapshot. Is the video ok?")
    if ok:
        # if so save the filesize, and md5 of the file
        md5 = md5sum(filename)
        print "snapshot: Using md5sum: %s" % md5
        with open(snapshot_md5_filename, 'w') as snapshot_md5_file:
            snapshot_md5_file.write(md5)
        shutil.copyfile(filename, snapshot_mov_filename)
    else:
        raise Exception("snapshot: not accepted")
示例#2
0
 def test_flip_180(self):
     filename = movie_path('flipped')
     new_filename = effects.flip_180(filename)
     # after being flipped the rotation data should be reset!
     self.failIfEqual(effects.get_rotation(new_filename), '180')
     return new_filename
示例#3
0
 def test_get_rotation(self):
     filename = movie_path('flipped')
     self.failUnlessEqual(effects.get_rotation(filename), '180')
示例#4
0
def check_rotation(video):
    rotation = effects.get_rotation(video.video.path)
    if rotation == "180":
        apply_effect(video, effect=effects.flip_180)