This file contains hidden or 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
| import subprocess | |
| import re | |
| import os | |
| import argparse | |
| import mimetypes | |
| from PIL import Image, ImageChops | |
| def get_crop_dimensions(input_file): | |
| """ | |
| Uses ffmpeg's cropdetect filter to find optimal crop dimensions. |
This file contains hidden or 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
| import os | |
| from PIL import Image | |
| import click | |
| @click.command() | |
| @click.argument('file', default="sheet.png") | |
| @click.argument('pieces', default="3x4") |
This file contains hidden or 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
| import hashlib | |
| def do_sha(fn): | |
| with open(fn, 'rb') as file_for_hash: | |
| data = file_for_hash.read() | |
| return hashlib.sha1(bytes('blob ', 'utf-8') + bytes(str(len(data)) + "\0", 'utf-8') + data).hexdigest() |