dogsheep / dogsheep-photos

Upload your photos to S3 and import metadata about them into a SQLite database
Apache License 2.0
172 stars 15 forks source link

Also upload movie files #13

Open simonw opened 4 years ago

simonw commented 4 years ago

The upload command currently only handles static images:

https://github.com/dogsheep/photos-to-sqlite/blob/d939455af00e07866686457ee2fcb9b2d1b7194e/photos_to_sqlite/utils.py#L26-L33

Need to cover movies taken by my phone and DSLR too.

simonw commented 4 years ago
>>> def ext_counts(directory):
...     counts = {}
...     for path in pathlib.Path(directory).glob("**/*"):
...         ext = path.suffix
...         counts[ext] = counts.get(ext, 0) + 1
...     return counts
... 
>>> 
>>> ext_counts("/Users/simon/Pictures/Photos Library.photoslibrary/originals")
{'': 16, '.heic': 15478, '.jpeg': 21691, '.mov': 946, '.png': 2262, '.gif': 38, '.mp4': 116, '.aae': 2}
simonw commented 4 years ago

I'm going to leave this until I have the mechanism for associating a live photo video with the photo.