Skip to content
This repository has been archived by the owner on Jan 21, 2023. It is now read-only.

Make it support gifs + use the virtualenv even if not currently activated #2

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,27 @@ run: montage
git submodule init
git submodule update
virtualenv -p python3 .venv
source .venv/bin/activate
pip install -r requirements.txt
source .venv/bin/activate; pip install -r requirements.txt

clean:
rm -rf .venv images images-cropped logs contrib
cleanvenv:
rm -rf .venv

cleanimages:
rm -rf images images-cropped logs contrib
rm -f montage.jpg

clean: cleanvenv cleanimages

images: .venv
. .venv/bin/activate
python -m selfie_bot
. .venv/bin/activate; python -m selfie_bot

images-cropped: images
mkdir images-cropped | true
convert -trim 'images/*' ./images-cropped/%04d.png

montage: images-cropped
python ./contrib/collage_maker/collage_maker.py -f ./images-cropped -o montage.jpg -w 1920 -i 360 -s
. .venv/bin/activate; python ./contrib/collage_maker/collage_maker.py -f ./images-cropped -o montage.jpg -w 1920 -i 360 -s


montage-horizontal: images-cropped
ls -d ./images-cropped/* | xargs -n 10 echo | xargs -I% bash -c "montage -background none -geometry 1920x1080 -tile x1 % out/montage-horizontal-\`dd if=/dev/urandom bs=1 count=4 2>/dev/null| xxd -ps\`.png"
2 changes: 2 additions & 0 deletions selfie_bot/image_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ def rotate_if_exif_specifies(image):
# No rotation tag present, so we don't need to rotate
logger.debug('EXIF data present but no rotation tag, so not transforming')
return image
except AttributeError:
return image

value_to_transform = {
1: (0, False),
Expand Down