summaryrefslogtreecommitdiff
path: root/macros/xetex/plain/do-it-yourself-tex/SHELL-FILES/border
blob: 93e50dc3773bae5541a9eef8eeb2f1a6a89060fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

#!/bin/bash
# border

# puts a border around ALL the  png and jpg photos in the directory
# saves the originals to a directory ORIGINALS/  and in the current directory 
# and adds "border_" to the new file

# change the following  values as desired
#  colour: #EEAA00 (brownish)  
#  border: 10 pixels wide 


# first eliminate the old ORIGINALS/ because if repeat
# one obtains nested ORIGINALS/!

rm -fR ORIGINALS/

# eliminate the extensions with capital letters
# no loop for rename
   rename  .PNG  .png  *.PNG
   rename  .JPG  .jpg  *.JPG

# new originals
mkdir ORIGINALS/
cp * ORIGINALS/


#  png
for img in `ls *.png`
do
     convert -mattecolor "#EEAA00" -frame 10x10 $img  border_$img
done


#  jpg
for img in `ls *.jpg`
do
     convert -mattecolor "#EEAA00" -frame 10x10 $img  border_$img
done