-
-
Save drezha/4be51096646fc06c4dc2cd643ec89729 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
#!/bin/bash | |
# Resize JPG files for Zim | |
# Chris Salter | |
# 14/05/2018 | |
# Relies on Imagemagick being installed | |
# Set Random String to rename images to | |
n=$RANDOM | |
# Resizes images to 1,228,800 pixels (1280x960, assuming a standard lanscape iPhone image of 4032x3024 pixels) | |
convert $1 -resize 1228800@ -format jpg /home/chris/Desktop/$n.jpg | |
# Thumbnail creation - 76,800 pixels (320 x 240) and adds white background to make 320x320 | |
convert $1 -resize 76800@ -format jpg -gravity center -background white -extent 330x330 /home/chris/Desktop/Thumbnail_$n.jpg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment