Added 10 more gists.
This commit is contained in:
1
print_all_images.sh/README.md
Normal file
1
print_all_images.sh/README.md
Normal file
@@ -0,0 +1 @@
|
||||
Bash script that prints all JPEG and PNG images inside the working directory.
|
19
print_all_images.sh/print_all_images.sh
Normal file
19
print_all_images.sh/print_all_images.sh
Normal file
@@ -0,0 +1,19 @@
|
||||
#! /bin/bash
|
||||
|
||||
FILES=`ls -1 *.[jp]*`
|
||||
ORIENTATION=" "
|
||||
|
||||
for f in $FILES
|
||||
do
|
||||
WIDTH=`identify $f | cut -d' ' -f3 | cut -d'x' -f1`
|
||||
HEIGHT=`identify $f | cut -d' ' -f3 | cut -d'x' -f2`
|
||||
if [ $WIDTH -lt $HEIGHT ]
|
||||
then
|
||||
ORIENTATION="portrait"
|
||||
else
|
||||
ORIENTATION="landscape"
|
||||
fi
|
||||
echo "Printing $f"
|
||||
echo
|
||||
lpr -o $ORIENTATION -o scaling=100 -o media=letter -o color=grayscale -o PrintQuality=photo $f
|
||||
done
|
Reference in New Issue
Block a user