Created
July 6, 2021 20:46
-
-
Save hexandcube/8e2c8aab22f64541f2966ca556d84daf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rules: | |
- folders: 'C:\' | |
filters: | |
- extension: | |
- .jpg | |
- .jpeg | |
- .png | |
- .mp4 | |
- .mkv | |
- .avi | |
- .gif | |
- .wmv | |
- exif | |
- python: | | |
import PIL.Image | |
from datetime import datetime | |
img = PIL.Image.open(path) | |
exif_data = img._getexif() | |
year = datetime.strptime(exif_data[36867], "%Y:%m:%d %H:%M:%S").year | |
month = datetime.strptime(exif_data[36867], "%Y:%m:%d %H:%M:%S").month | |
day = datetime.strptime(exif_data[36867], "%Y:%m:%d %H:%M:%S").day | |
return {"year": year, "month": month, "day": day} | |
actions: | |
- echo: 'Date: {python.year}-{python.month}-{python.day}' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment