-
Notifications
You must be signed in to change notification settings - Fork 0
/
miquel.py
68 lines (44 loc) · 1.29 KB
/
miquel.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import photos
#print(dir (photos))
# help(photos)
def show_photo(index=-1):
all_assets = photos.get_assets()
last_asset = all_assets[index]
img = last_asset.get_image()
img.show()
print(len(all_assets))
def show_frame(index, frame):
videos = photos.get_assets(media_type='video')
video = videos[index]
print(video.local_id)
print(dir(video))
print(video.duration)
print(video.location)
print(video.get_image_data())
get_video = video.get_image()
print(dir(video.get_image))
# help(video)
# help(video.get_image())
# video.seek(frame)
get_video.show()
#get_video2 = video.get_image().seek(1)
# get_video2.show()
get_video2 = video.seek(frame)
get_video2.show()
print(len(videos))
# help(video.get_image())
# show_photo(100)
show_frame(-100, 20)
# https://github.com/tdamdouni/Pythonista/blob/master/video/quicklook-video.py
# https://forum.omz-software.com/topic/482/how-to-save-image-via-photos-save_image
"""
import Image
import photos
from urllib import urlopen
from io import BytesIO
print "Downloading image..."
url = "http://omz-software.com/pythonista/docs/_static/pythonista_icon.png"
img = Image.open(BytesIO(urlopen(url).read()))
photos.save_image(img)
print "Image saved to camera roll."
"""